Re: Converting epoch to timestamp

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Glaesemann <grzm(at)myrealbox(dot)com>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Converting epoch to timestamp
Date: 2004-07-16 05:12:36
Message-ID: 40F763C4.7060003@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> This is in fact wrong, unless you live in the British Isles: the
> result will be off by your timezone displacement from UTC. Correct
> is to use timestamptz not timestamp.
>
> As an example: timestamp 1089953023 equates to Fri Jul 16 2004, 00:43:43 EDT
> according to strftime() on my machine (I live in US Eastern zone which
> is presently GMT-4). I get

I would actually prefer this syntax:

SELECT EXTRACT(EPOCH FROM TIMESTAMP '2003-01-01 11:23:44');

Chris

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Clift 2004-07-16 05:14:38 Re: pg_dump - option for just dumping sequences?
Previous Message Tom Lane 2004-07-16 05:03:19 Re: [HACKERS] Weird new time zone