Hi all,

I'm facing the following problem when initializing a QDateTime with time_t value.
I get the last modified timestamp of a file as time_t value

...
    time_t mtime;
    struct stat statbuf;
    fstat(fd, &statbuf);
    mtime = statbuf.st_mtime;
    ...

Then I use that mtime value to initialize a QDateTime as follows:

QDateTime myDateTime = QDateTime::fromTime_t(f_mtime);

The date time printed doing a myDateTime.toString() is

    Wed Dec 5 12:36:18 2007


Retrieving the last modified information using QFileInfo, the result is different

    QFileInfo fi(filepath);
    QDateTime myDateTime = fi.lastModified();

I get this result

    Wed Dec 5 11:36:18 2007

That is there is one hour difference. I guess the difference is due to the daylight saving management,
but I can not understand how that management is performed.

Note: if I look at the file properties on Windows dialog, the last modified time is shown as

    Wed Dec 5 12:36:18 2007



Thanks in advance for your help.
    Calogero

--
Calogero Mauceri
Software Engineer

Applied Coherent Technology Corporation (ACT)
www.actgate.com

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to