Adding a date and an interval...

From: "Ian Harding" <ianh(at)co(dot)pierce(dot)wa(dot)us>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Adding a date and an interval...
Date: 2001-05-21 22:24:52
Message-ID: sb0933d5.041@emgateways.co.pierce.wa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)tpchd(dot)org

Browse pgsql-general by date

  From Date Subject
Next Message Lee Harr 2001-05-21 22:28:03 Re: Select statement
Previous Message Justin Clift 2001-05-21 22:11:48 Re: how to install postgresql