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?

Cheers,
-Patrick

P.S. Here is my original inconclusive entry in the qt forum:
https://forum.qt.io/topic/107005/qdatetime-uses-different-time-zone-offset-prior-to-unix-epoch/6
 
<https://forum.qt.io/topic/107005/qdatetime-uses-different-time-zone-offset-prior-to-unix-epoch/6>



_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest

Reply via email to