[Interest] QDateTime Issue in Qt5.8.0 msvc2013,msvc2015

Mike Chinander chinander at gmail.com
Wed Feb 1 16:02:22 CET 2017


On Wed, Feb 1, 2017 at 8:44 AM, Günter Michel <gm at mes-ia.de> wrote:

> This simple code returns an invalid date compiled with Qt5.8.0 msvc2013:
>
> QDateTime dt = QDateTime::currentDateTime();
>
> Compiling with mingw results in correct date but wrong time. Code works in
> Qt5.7.1
> What's going on here?
>


This is what I get with 5.8.0RC and msvc2013 on Windows 7 (it's correct):

    QDateTime dt = QDateTime::currentDateTime();
    qDebug() << "Current Date: " << dt;
    qDebug() << "Current Date: " << dt.toString(Qt::ISODateWithMs);

Output:

Current Date:  QDateTime(2017-02-01 08:52:22.838 Central Standard Time
Qt::TimeSpec(LocalTime))
Current Date:  "2017-02-01T08:52:22.838"

What exactly do you mean by "invalid date"?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170201/c2db3a23/attachment.html>


More information about the Interest mailing list