Re: timezone difference in timestamp? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: timezone difference in timestamp?
Date
Msg-id 20061106185620.GA857@svana.org
Whole thread Raw
In response to timezone difference in timestamp?  (meltedown <asdf@fake.com>)
List pgsql-general
On Mon, Nov 06, 2006 at 03:30:35PM +0000, meltedown wrote:
> Short version: I'm trying to turn a unix timestamp into a psql
> timestamp, but there is a 5 hour difference. Is this because of
> timezones ? Can I just subtract 5 hours to get the right value ?

Not sure what you're using, but by my calculations postgresql is
correct.

$ perl -e 'print scalar(gmtime(1162789200)),"\n"'
Mon Nov  6 05:00:00 2006

Make sure you understand whether the dates your comparing are in the
same timezone. Maybe you want 'timestamp with time zone'.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Matt Miller"
Date:
Subject: cvs HEAD initdb: vacuuming database template1 ... FATAL: could not identify a comparison function for type aclitem
Next
From: Tom Lane
Date:
Subject: Re: timezone difference in timestamp?