-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.8.5, 5.0.2, 5.1.1, 5.2.0 Beta1
-
None
-
Windows 7
-
6d3e5ac6d2f34a0da609f863bed95d3be571c589
Under windows it shows wrong daylight savings before 2007 on US eastern time -05:00
Windows
"UTC" "Wed Nov 1 12:00:00 2006"
"Local" "Wed Nov 1 08:00:00 2006" <-
"UTC" "Thu Nov 1 12:00:00 2007"
"Local" "Thu Nov 1 08:00:00 2007"
Mac/Linux
"UTC" "Wed Nov 1 12:00:00 2006"
"Local" "Wed Nov 1 07:00:00 2006" <-
"UTC" "Thu Nov 1 12:00:00 2007"
"Local" "Thu Nov 1 08:00:00 2007"
Example:
int main()
{
qDebug()
<< "UTC" << QDateTime( QDate( 2006, 11, 1 ), QTime( 12, 0, 0 ), Qt::UTC ).toString() << endl
<< "Local" << QDateTime( QDate( 2006, 11, 1 ), QTime( 12, 0, 0 ), Qt::UTC ).toLocalTime().toString() << endl
<< "UTC" << QDateTime( QDate( 2007, 11, 1 ), QTime( 12, 0, 0 ), Qt::UTC ).toString() << endl
<< "Local" << QDateTime( QDate( 2007, 11, 1 ), QTime( 12, 0, 0 ), Qt::UTC ).toLocalTime().toString() << endl;
}
If use windows native API from MSDN then it handles correctly daylight savings