Re: timezone difference in timestamp?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: meltedown <asdf(at)fake(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: timezone difference in timestamp?
Date: 2006-11-06 18:56:20
Message-ID: 20061106185620.GA857@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2006-11-06 18:58:14 Re: Need replacement booth member for USENIX Lisa
Previous Message Just Someone 2006-11-06 18:29:28 Re: Schema search_path and views