OK my fault, qDebug() results are also ok here, seems debug view related.
I have looked at debugger Output in Qt Creator 4.2.0 ( dt (invalid) )

Am 01.02.2017 um 16:02 schrieb Mike Chinander:


On Wed, Feb 1, 2017 at 8:44 AM, Günter Michel <[email protected] <mailto:[email protected]>> wrote:

    This simple code returns an invalid date compiled with Qt5.8.0
    msvc2013:

    QDateTimedt=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"?




_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest


--
MES Industrieautomation GmbH
Simmershäuser Straße 102D
D-34125 Kassel

Tel.  0049(0561) 813004
Fax   0049(0561) 813005
Mobil +49 172 9822485
E-mail: [email protected]
http:// [email protected]

Registergericht: Amtsgericht Kassel HRB5618

Geschäftsführer: Ralf Brüne
                 Günter Michel
                 Axel Rosenthal
                 Manfred Stangl

_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to