On Wed, Oct 06, 2004 at 04:26:06PM -0400, Bruno Pr?vost wrote: > > I'm using postgres version 7.4.5 and had a problem with interval > > Here is my query : > select '2004/10/31'::timestamptz + '1 day'::interval; > > Here is the answer : > 10/31/2004 11:00:00 PM
I'd guess that Daylight Saving Time is the culprit -- most places that use it revert to Standard Time on 31 Oct this year. Suppose you're in the EST5EDT time zone, which is 4 hours behind UTC during the summer. '2004/10/31'::timestamptz is '2004-10-31 00:00:00-04'. If you add one day, that would be '2004-11-01 00:00:00-04'. Only by then you're 5 hours behind UTC instead of 4 hours behind, so the time becomes '2004-10-31 23:00:00-05', which is the same time adjusted for your time zone. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org