<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi all,<br>
<br>
I'm facing the following problem when initializing a QDateTime with
time_t value.<br>
I get the last modified timestamp of a file as time_t value<br>
<br>
<tt>...</tt><tt><br>
</tt><tt> time_t mtime;</tt><tt><br>
</tt><tt> struct stat statbuf;</tt><tt><br>
</tt><tt> fstat(fd, &statbuf);</tt><tt><br>
</tt><tt> mtime = statbuf.st_mtime;</tt><tt><br>
</tt><tt> ...</tt><br>
<br>
Then I use that mtime value to initialize a QDateTime as follows:<br>
<br>
<tt> </tt><tt>QDateTime myDateTime = QDateTime::fromTime_t(f_</tt><tt><tt>mtime</tt>);</tt><br>
<br>
The date time printed doing a myDateTime.toString() is<br>
<br>
<span style=" font-family:'Courier New,courier';"> <tt> Wed Dec
5 12:36:18 2007</tt></span><br>
<br>
<br>
Retrieving the last modified information using QFileInfo, the result
is different<br>
<br>
<tt> QFileInfo fi(filepath);</tt><tt><br>
</tt><tt> QDateTime myDateTime = fi.lastModified();</tt><br>
<br>
I get this result<br>
<br>
<tt> Wed Dec 5 11:36:18 2007</tt><br>
<br>
That is there is one hour difference. I guess the difference is due
to the daylight saving management,<br>
but I can not understand how that management is performed.<br>
<br>
Note: if I look at the file properties on Windows dialog, the last
modified time is shown as<br>
<br>
<span style=" font-family:'Courier New,courier';"><tt> Wed Dec 5
12:36:18 2007</tt></span><br>
<br>
<br>
<br>
Thanks in advance for your help.<br>
Calogero<br>
<pre class="moz-signature" cols="72">--
Calogero Mauceri
Software Engineer
Applied Coherent Technology Corporation (ACT)
<a class="moz-txt-link-abbreviated" href="http://www.actgate.com">www.actgate.com</a></pre>
</body>
</html>