parsedate accepts a ZONE parameter that can either be an offset or a
short timezone name (which unfortunately has conflicts). This causes
problems when you hand parsedate an offset and ask it to parse a future
date that isn't in daylight savings while your code is currently running
under a daylight savings timezone.
I've attached code that shows the problem we're having, but I'll
summarize. We convert our stored timezone (America/New_York) into an
offset (currently -0400) and hand that to parsedate along with a
user provided input. That could be tomorrow, or it could be 2009-12-24.
I'm showing the test with 2009-12-24 for simplicity, but I could easily
construct this to run on 2007-11-04 when the US cuts over from daylight
savings. When we get back seconds and turn them into a date in the
correct timezone, we end up with one day earlier at 23:00. I have to
realize that this is wrong in my code and then re-parse with the -0500
offset. If parsedate took timezone names, rather than short names, this
would "work".
Subject: | parsedate |
Message body not shown because it is not plain text.