Re: timestamp (military) at time zone without the suffix - Mailing list pgsql-general

From David G. Johnston
Subject Re: timestamp (military) at time zone without the suffix
Date
Msg-id CAKFQuwYU2GgTnaOOQHxGSBfEZR1XxzN4PYKjNeovWuJTFYk2cA@mail.gmail.com
Whole thread Raw
In response to Re: timestamp (military) at time zone without the suffix  (David Gauthier <davegauthierpg@gmail.com>)
List pgsql-general
On Wednesday, July 11, 2018, David Gauthier <davegauthierpg@gmail.com> 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.

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: Open Source tool to deploy/promote PostgreSQL DDL
Next
From: "Igal @ Lucee.org"
Date:
Subject: Re: How to tell which event was fired in Trigger function