Thank you very much, sir.
After posting I realized that my question did not cover my problem. I
also need to calculate if a given time is within daylight savings time
The actual situation is this: I have a table that contains the time at
which an event occurred and an estimate of how long it will be before a
second event occurs. That interval is likely to be in the range of 2-3
days. I need to handle the case in which that span includes the moment
at which daylight savings time status changes. The table stores the
event time in both local time and UTC time. So, I need a way to
calculate whether the time at the end of the interval will be DST or
I also have a table named "sys_info" that contains a single record for
system-wide information. I can expand that table if I want. The
easiest way I can think of to do what I need is merely to store the DST
start and end dates in that table, and then see if the date I'm checking
is between them or not. But that won't work either, since the dates
change. In the US, DST runs from the second Sunday in March to the
first Sunday in November. I can hard-code to that rule (which is what
I'm doing for now), but I can't very well store it in a database. And
do other countries use DST, and if so, how do they define it?
I think that, if I'm careful, I can write my function so I'll be
converting everything I need to UTC before I start, and then I won't
convert anything back until the very end, and I'll never have to worry
about whether I'm spanning the DST change or not.
It would still be nice to have a function that will check DST for a
given date, but I hope I can avoid needing it.
In response to
pgsql-general by date
|Next:||From: Rob Richardson||Date: 2008-07-29 20:24:08|
|Subject: How do I set up automatic backups?|
|Previous:||From: Francisco Reyes||Date: 2008-07-29 19:34:32|
|Subject: Re: Index creation and maintenance_work_mem|