Re: Problem with interval
От | Michael Fuhr |
---|---|
Тема | Re: Problem with interval |
Дата | |
Msg-id | 20041006214755.GA9678@winnie.fuhr.org обсуждение исходный текст |
Ответ на | Problem with interval (Bruno Prévost <bp@interaction.ws>) |
Список | pgsql-bugs |
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/
В списке pgsql-bugs по дате отправления: