Adding a date and an interval... - Mailing list pgsql-general

From Ian Harding
Subject Adding a date and an interval...
Date
Msg-id sb0933d5.041@emgateways.co.pierce.wa.us
Whole thread Raw
List pgsql-general
Why does this happen?  When I do this,

select cast('10/28/01' as date) + cast('1 day' as interval);

I get 2001-10-28 23:00:00-08, when I expect 2001-10-29 etc.  I am using this in a loop in a pltcl function.

I know this is the end of daylight savings, but I assumed 1 day is not always 24 hours if the DB knows about daylight
savings.

How should I go about consistently stepping through the days of the year?

Thanks!!

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: ianh@tpchd.org


pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Re: how to install postgresql
Next
From: Paul Tomblin
Date:
Subject: Re: Why can't I do this (setup question)