Skip site navigation (1) Skip section navigation (2)

Re: timestamp wiht time zone

From: "Jasbinder Singh Bali" <jsbali(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: timestamp wiht time zone
Date: 2007-06-27 20:58:11
Message-ID: a47902760706271358h27441223r95e6bd8a98d79acd@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
Thanks Alvaro,
Your information proved very handy.
~Jas

On 6/27/07, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
>
> Jasbinder Singh Bali escribió:
> > Hi,
> > i have a column in my table defined like this:
> >
> > time_stamp timestamp DEFAULT ('now'::text)::timestamp with time zone
>
> Note that the column is of type timestamp, which _doesn't_ have a time
> zone.  You probably want
>
> time_stamp timestamp with time zone DEFAULT ('now'::text)::timestamp with
> time zone
>
> > 1. What is the value after the dot (period) at the end. Like 760133 and
> > 90582
>
> milliseconds
>
> > 2. How does it talk about the time zone.
>
> It doesn't because the time zone information is not being stored due to
> the datatype issue I mentioned above.
>
> Note: the time zone is not actually stored.  What actually happens is
> that the value is "rotated" to GMT and stored as a GMT value, and then
> when you extract it from the database it is "rotated" to the current
> TimeZone for display.  If you need to store what time zone a value "is
> in" you need to store that information in a separate column.
>
> --
> Alvaro Herrera
> http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
>

In response to

pgsql-general by date

Next:From: Danyelle GragsoneDate: 2007-06-27 20:59:54
Subject: Re: postgres and webmin
Previous:From: Andrej Ricnik-BayDate: 2007-06-27 20:46:35
Subject: Re: postgres and webmin

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group