Forum OpenACS Q&A: Response to PostgreSQL: time zones and daylight savings

Collapse
Posted by Janine Ohmer on
Simon, I hope you don't mind my jumping in here but I'm curious about this too...

The problem is this:  his user says she wants a reminder e-mailed to her at 3:00 pm.  She's currently in EST, so that's the timezone she chooses, and the system can calculate the time to send it to her with "GMT - 5".

The problem comes in when the user goes on Daylight Savings Time; the calculation has to be "GMT - 4" instead (for my example).  His code needs some way of knowing which offset to use at a particular moment in time.

I'm sure there are rules about when DST starts and stops, but we were hoping there would be something already written to handle this.