On terça-feira, 27 de agosto de 2013 21:40:29, Constantin Makshin wrote: > When converting time from UTC to local time, Windows uses the *current* > state of daylight saving, not one that was active at the time the > original timestamp is "pointing" to.
Hmm... we have two versions of the code: FileTimeToSystemTime and gmtime. Are you saying that gmtime is broken and does not apply the correct historical daylight saving settings? #if defined(Q_OS_WINCE) tm res; FILETIME localTime = time_tToFt(secsSince1Jan1970UTC); SYSTEMTIME sysTime; FileTimeToSystemTime(&localTime, &sysTime); FILETIME resultTime; LocalFileTimeToFileTime(&localTime , &resultTime); FileTimeToSystemTime(&resultTime , &sysTime); res.tm_sec = sysTime.wSecond; res.tm_min = sysTime.wMinute; res.tm_hour = sysTime.wHour; res.tm_mday = sysTime.wDay; res.tm_mon = sysTime.wMonth - 1; res.tm_year = sysTime.wYear - 1900; res.tm_isdst = (int)isdst; brokenDown = &res; #elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) // use the reentrant version of gmtime() where available tm res; brokenDown = gmtime_r(&secsSince1Jan1970UTC, &res); #elif defined(_MSC_VER) && _MSC_VER >= 1400 tm res; if (!_gmtime64_s(&res, &secsSince1Jan1970UTC)) brokenDown = &res; #else brokenDown = gmtime(&secsSince1Jan1970UTC); #endif // !QT_NO_THREAD && _POSIX_THREAD_SAFE_FUNCTIONS -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest