The following bug has been logged online:
Bug reference: 1757
Logged by: Steve Bennett
Email address: S.Bennett@lancaster.ac.uk
PostgreSQL version: 8.0.3
Operating system: Linux
Description: timestamp 'epoch' is not absolute
Details:
I'm seeing a rather annoying problem converting timestamps between unix and
PostgreSQL. It appears that the timestamp 'epoch' is being interpreted as
relative to the local timezone, rather than being an absolute time.
e.g. I'm in the UK, and at the moment we're in summer time, which is UTC+1.
If I do:
select date_part('epoch', timestamp 'epoch');
I get:
date_part
-----------
-3600
Whereas if I do:
select date_part('epoch', timestamp 'epoch' AT TIME ZONE 'UTC');
I get:
date_part
-----------
0
Am I misunderstanding what's going on here?
Is there any circumstance where 'epoch' should vary according to the
timezone that you happen to be in?
Thanks in advance
Steve.