QFileInfo::lastModified seems to be one hour off
I have a QT program that has been functioning properly in Windows for a few months, but recently (after the DST shift maybe?) started acting strangely. I have the following function:
Code:
if (!obFileInfo.exists() ) {
qDebug() << "File " << sFilename << " does not exist, no local stamp";
*pbSuccess = false;
return( obStamp );
}
//qDebug() << "Checking local stamp on " << sFilename;
obStamp = obFileInfo.lastModified();
*pbSuccess = true;
return( obStamp );
} //GetLocalStamp
If I qDebug() the returned QDateTime object, it is one hour off from the time the Operating system reports. Is this a known issue, or is there some step I am missing?
Re: QFileInfo::lastModified seems to be one hour off
What does obStamp.timeSpec() return?
Re: QFileInfo::lastModified seems to be one hour off
Quote:
Originally Posted by
jacek
What does obStamp.timeSpec() return?
0 (Qt::LocalTime)
Re: QFileInfo::lastModified seems to be one hour off
I couldn't find anything in Trolltech's task tracker, so I think it will be better if you prepare a minimal compilable example and contact the Trolls.
Re: QFileInfo::lastModified seems to be one hour off
Quote:
Originally Posted by
jacek
I couldn't find anything in Trolltech's task tracker, so I think it will be better if you prepare a minimal compilable example and contact the Trolls.
This is starting to look like a Windows issue more than a QT issue. I am setting the timestamp of the file myself using utime in another part of the code (this program downloads updates off of the Internet, sets their timestamp to the server timestamp, and upon subsequent executions, compares client-side stamps to server-side stamps).
http://img389.imageshack.us/img389/1...ronghi5.th.jpg
Check out this screen shot...I ran a little test app to show the modify time of two executables, and I am getting two different results, even though Windows is showing an identical modify time. What is even stranger is that neither result I get from the QT call is the same as what Windows reports, however, the 16:14 time is what I tried to set it to with utime (this file is a copy and paste of the file I downloaded.)
Is there something "under the hood" of the stamps that could be causing this? Do Windows files have any sort of meta-info that may be scrambling this?