Got an error that I mentioned in the comments:
QDateTime local = QDateTime::currentDateTime(); QDateTime utc = local.toUTC(); utc.setTimeSpec(Qt::LocalTime); int utcOffset = utc.secsTo(local); qDebug() << local.toString(Qt::ISODate); qDebug() << utc.toString(Qt::ISODate); qDebug() << utcOffset; local.setUtcOffset(utcOffset); qDebug() << local.toString(Qt::ISODate);
It is output:
"2013-09-12T00:17:39" "2013-09-11T21:17:39" 10800 "2013-09-12T00:17:39+03:00"
user362638
source share