Search Postgresql Archives

Re: timestamp (military) at time zone without the suffix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, July 11, 2018, David Gauthier <davegauthierpg@xxxxxxxxx> wrote:
I want to store the current UTC date/time in the DB.  Does PG unconditionally store something like UTC, then let the queries figure out how they want to look at it (with "at time zone" and "to_char()" etc...) ?  Or do I have to intentionally store the UTC value somehow?

If you use timestamptz the server interprets the stored value as being UTC.  If you use timestamp the server interprets the stored value using whatever the current Time Zone happens to be when the value is read (or it uses the at time zone value if specified).

David J.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux