Hi Thiago, On 06/12/12 17:31, Thiago Macieira wrote: > There isn't a way. The QTimezone feature has been pending for years.
Right, it seems that the utcOffset won't survive a serialization to QDataStream (using Qt 4.8.1): QDateTime blah = QDateTime::fromString("1997-07-16T19:20:30+09:45", Qt::ISODate); qDebug() << blah << blah.toLocalTime() << blah.toUTC(); QByteArray buf; QDataStream writing(&buf, QIODevice::ReadWrite); writing << blah; QDataStream reading(&buf, QIODevice::ReadOnly); QDateTime anotherDate; reading >> anotherDate; qDebug() << anotherDate << anotherDate.toLocalTime() << anotherDate.toUTC(); $ TZ=Europe/Prague ./myapp QDateTime("Wed Jul 16 19:20:30 1997") QDateTime("Wed Jul 16 19:20:30 1997") QDateTime("Wed Jul 16 09:35:30 1997") QDateTime("Wed Jul 16 19:20:30 1997") QDateTime("Wed Jul 16 19:20:30 1997") QDateTime("Wed Jul 16 19:20:30 1997") Weird thing is that the output doesn't change regardless if I set TZ to America/Chicago, Europe/Prague or Asia/Tehran. Weird, and a bug, I guess. Looks like I'm really out of luck here. > You're entirely on your own if you touch the internals. Behaviour might > change > in any release. Fair enough. The better question is then "any chances of making these two functions public in a 4.x release"? With kind regards, Jan -- Trojita, a fast e-mail client -- http://trojita.flaska.net/
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest