Re: int4 -> unix timestamp -> sql timestamp; abstime? - Mailing list pgsql-general

From Tom Lane
Subject Re: int4 -> unix timestamp -> sql timestamp; abstime?
Date
Msg-id 5655.1105490686@sss.pgh.pa.us
Whole thread Raw
In response to Re: int4 -> unix timestamp -> sql timestamp; abstime?  (David Fetter <david@fetter.org>)
Responses Re: int4 -> unix timestamp -> sql timestamp; abstime?  (David Fetter <david@fetter.org>)
List pgsql-general
David Fetter <david@fetter.org> writes:
>> The recommended locution is
>>
>> SELECT TIMESTAMP WITH TIME ZONE 'epoch' + <x> * INTERVAL '1 second';

> I think this should read:

> SELECT TIMESTAMP WITH TIME ZONE 'epoch' AT TIME ZONE 'UTC' + <x> * INTERVAL '1 second';
> /*                                      ^^^^^^^^^^^^^^^^^^ */

It's correct as written; your modification throws it off by the local GMT
offset.

            regards, tom lane

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: int4 -> unix timestamp -> sql timestamp; abstime?
Next
From: Roman Neuhauser
Date:
Subject: Re: int4 -> unix timestamp -> sql timestamp; abstime?