M
M
Mars362021-03-04 20:49:06
Qt
Mars36, 2021-03-04 20:49:06

How to get time in ISO 8601 format with timezone?

Need to get: 2014-11-07T16:21:02+03:00 After reading
the documentation, it turned out this:

QDateTime::currentDateTime().toTimeSpec( Qt::OffsetFromUTC ).toString( Qt::ISODate )

what the output gives: 2021-03-04T20:40:45Z
How to display the timezone correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ighor July, 2021-03-04
@Mars36

There are examples here https://doc.qt.io/qt-5/qt.html#DateFormat-enum

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question