On 3 nov 2007, at 12.26, Charles Seaton wrote:
select ('12/31/2006 UTC'::timestamptz + '307 days 02:45:30'::interval)
However, this gives an incorrect result (off by 1 hour)
"2007-11-02 18:45:30-07"
Have you checked your servers TimeZone setting? Also, which Postgres
version are you running? I get the following from 8.2.5, which seems
to be correct:
test=# select ('2006-12-31 UTC'::timestamptz + '307 days
02:45:30'::interval) AT TIME ZONE 'MST';
timezone
---------------------
2007-11-02 19:45:30
(I have a different DateStyle setting, so I had to change the input
format. I also added the 'AT TIME ZONE' statement, since my server's
in another time zone.)
Sincerely,
Niklas Johansson
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings