Re: Timestamp with vs without time zone. - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Timestamp with vs without time zone.
Date
Msg-id YUornXkmeFOeiaud@hjp.at
Whole thread Raw
In response to Re: Timestamp with vs without time zone.  (FWS Neil <neil@fairwindsoft.com>)
List pgsql-general
[Can y'all please trim your quotes? Having to scroll down 80+ lines to
get to the content is cumbersome]

On 2021-09-21 13:17:39 -0500, FWS Neil wrote:
> A timestamp cannot have a time zone and be a valid timestamp.
>
> Let me explain.
>
> A timestamp is a single time that exists in the world.

Correct.

> For example March 1, 2021, 4:15 am is a timestamp.

This is NOT a timestamp, because it is not a single time that exists in
the world. It is about 30 different times that exist in the world.

You can turn it into a timestamp by adding timezone information:

March 1 2021, 4:15 am, America/Chicago

Now it's a single time, equivalent to 2021-03-01T10:15:00Z.

However, if you don't have to store the timezone if you have some other
way to unambiguously specify the time, e.g. by always using UTC or by
storing seconds since an epoch.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment

pgsql-general by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: Re: Re: Timestamp with vs without time zone.
Next
From: Adrian Klaver
Date:
Subject: Re: Timestamp with vs without time zone.