⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

How to get yyyy-MM-ddThh: mm: ssTZD from QDateTime

  • I'm trying to get the time zone date using QDateTime, what I expect is something like 2018-03-19T00: 00: 00-02: 00 but what I get is 2019-10-27T19: 56: 09-2147483648

    QDateTime dh = QDateTime::currentDateTimeUtc();
        QString dataHoraEmi = dh.toString("yyyy-MM-ddThh:mm:ss");

  • Lifetime Qt Champion


    Are you looking to the date in the ISO-8601 format ? If so, I think this overload of toString will be of interest.

    Hope it helps

Log in to reply