[Qt-interest] QDateTime::fromString() and Qt::ISODate

Colleen Vermillion cvermillion at bibblelabs.com
Thu Aug 20 01:05:20 CEST 2009


I'm having trouble getting QDateTime::fromString() working with the offset
TZD specified in ISO 8601, i.e. 
1997-07-16T19:20:30.45+01:00

I'm trying to store all times internally as UTC, and XMP specification
allows for the TZD to be either "Z" (aka UTC) or an offset from UTC. I don't
really care what time zone the offset indicates; I just want it converted to
UTC when the string is parsed. I know that QDateTime detects the "Z" at the
end and sets the date as UTC, so what I'm hoping it will do eventually is
parse the offset, add/subtract it, and set the time as UTC instead of local
time. 

I don't suppose anyone out there has already written something to handle the
offsets?

-Colleen




More information about the Qt-interest-old mailing list