<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QDateTime Troubles.]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I found out some problems in using the QDateTime class within the simplest code (a form, a button, some further line codes for test).<br />
I'm running my QT Creator 3.3.0 (Qt 5.4.0) under Windows 10 and I couldn't try the same code under other operating systems yet.<br />
I got my first strange results in trying to extract some file data through the QFileInfo class: all the QDateTime results (i.e. lastModified,lastRead,created methods on an existing file) gives me the starting time "Jenuary 1st 1970, 00:00:00".<br />
I tried to use the QDateTime class directly, having the same results:</p>
<pre><code>QDateTime theCurrentDateTime = QDateTime::currentDateTime();
QDateTime theCurrentDTUTC = QDateTime::currentDateTimeUtc();
</code></pre>
<p dir="auto">both are set to the same Jenuary the 1st 1970 at midnight!</p>
<p dir="auto">I also tried the QDate and QTime classes that gave me the expected result:</p>
<pre><code>QDate theCurrentDate = QDate::currentDate();
QTime theCurrentTime = QTime::currentTime();
</code></pre>
<p dir="auto">Thanx for paying me attention, hope this could be useful.<br />
Yours,<br />
Giuseppe Micheli.</p>
]]></description><link>https://forum.qt.io/topic/69859/qdatetime-troubles</link><generator>RSS for Node</generator><lastBuildDate>Mon, 04 May 2026 14:59:37 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/69859.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Aug 2016 09:02:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QDateTime Troubles. on Thu, 04 Aug 2016 10:01:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi mates.<br />
First of all thank u a lot for your immediate replies.<br />
I updated my Qt environment to the 3.5.1 version for Qt Creator (based on Qt 5.5.1) and the problem has been solved.<br />
Paul, I debugged the call to the (static) currentDateTimeUtc using the creator internal debugger and having the same troubles; I have the old version still on my PC, so, if you wanna me to make any further attempts feel free to ask me.<br />
Thank you very much again.<br />
Yours,<br />
Giuseppe</p>
]]></description><link>https://forum.qt.io/post/340769</link><guid isPermaLink="true">https://forum.qt.io/post/340769</guid><dc:creator><![CDATA[giuseppe micheli]]></dc:creator><pubDate>Thu, 04 Aug 2016 10:01:24 GMT</pubDate></item><item><title><![CDATA[Reply to QDateTime Troubles. on Tue, 02 Aug 2016 22:58:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/giuseppe-micheli">@<bdi>giuseppe-micheli</bdi></a>, and welcome :)</p>
<p dir="auto">That does sound like an odd problem, possibly specific to the machine you're on.</p>
<p dir="auto">Out of curiosity, how are you checking the value of the QDateTime?  What does it show if you simply stream the QDateTime to qDebug like:</p>
<pre><code>const QDateTime theCurrentDTUTC = QDateTime::currentDateTimeUtc();
qDebug() &lt;&lt; theCurrentDTUTC;
</code></pre>
]]></description><link>https://forum.qt.io/post/340510</link><guid isPermaLink="true">https://forum.qt.io/post/340510</guid><dc:creator><![CDATA[Paul Colby]]></dc:creator><pubDate>Tue, 02 Aug 2016 22:58:06 GMT</pubDate></item><item><title><![CDATA[Reply to QDateTime Troubles. on Wed, 03 Aug 2016 05:58:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/giuseppe-micheli">@<bdi>giuseppe-micheli</bdi></a><br />
can you retry with the latest Qt version?<br />
Have you compiled Qt yourself? If no, i suspect a Qt bug...</p>
]]></description><link>https://forum.qt.io/post/340343</link><guid isPermaLink="true">https://forum.qt.io/post/340343</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Wed, 03 Aug 2016 05:58:46 GMT</pubDate></item></channel></rss>