[Interest] QDateTime uses different time zone offset prior to UNIX epoch?
patrickkidd at gmail.com
Fri Sep 20 23:20:40 CEST 2019
QDateTime initializes with a different time zone offset when passed a QDate before versus after Jan 1 1970. The following line says it all:
QDateTime(QDate(1969, 10, 14)).offsetFromUtc() != QDateTime(QDate(1970, 10, 14)).offsetFromUtc()
It seems to me that the offsets for these two QDateTime objects should be equal. Otherwise, this makes initializing and storing dates difficult.
I assume this is intentional. What is the rationale for this design decision? Is there a workaround?
P.S. Here is my original inconclusive entry in the qt forum:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest