I have some code where I write a QDateTime to a file...
someQDateTime.toUTC().toString(Qt::ISODate)
and when I read it back using QDateTime::fromString()
, I get the time interpreted as being in the system's time zone. I can manually append "Z" to the string when I write it out, or use setTimeSpec()
after I read it, and then everything is fine, but is this the preferred way of doing this? Shouldn't toString() know to write out a Z when the timeSpec is UTC?