According to QtAssistant, the QDateTime class is aware of Daylight Savings Time, but there either seems to be some gaps, or I'm overlooking something.
The specific problem I have is that I need to converted formated date/time strings into a QDateTime; there's good support for that except (as far as I can see) when DST ends. A specific example is that, in 2010, in most of the U.S., DST ended on November 7, 2010 at 2:00 AM; the clock was set back an hour, producing two 2:00's and two hours between 1:00 and 2:00.
So if I have the string below to parse, it's impossible to determine, from the string alone, whether it's the first 1:15 AM on that day or the second one.
Nov 7, 2010 01:15
We keep a DST flag to identify these from when the formatted text was created (and no, I don't have the option of rewriting the system to pass UTC everywhere...sorry). Our existing date/time functions (that I'm trying to avoid because they're terrible) accept this flag and adjust the resulting UTC time accordingly.
Qt doesn't seem to provide any way of allowing me to specify which of those hours the string represents. I can check the flag and if set, add an hour to the result, but that will break down in locales that change time by some value other than an hour. Those are probably not relevant for my purposes at this time, but I hate to code something that I know is wrong.
Ideas?
Doug
Bookmarks