Force QDateTime.toString() to display UTC time
Solved
General and Desktop
-
wrote on 8 Mar 2021, 09:26 last edited by
How do I force QDateTime.toString () to display UTC time?
If I change the time zone on my computer, then the output of the function also changes. It's pretty obvious, so I added setTimeSpec(Qt::UTC) but it still doesn't work!
I think I am using this incorrectly?
How can I force toString to output timestamp exclusively in UTC format without being bound to the local machine time zone? -
wrote on 8 Mar 2021, 09:29 last edited by
As stated in the documentation you need to use QDateTime::toUTC().
-
As stated in the documentation you need to use QDateTime::toUTC().
1/3