QDateTime localDate = QDateTime::fromString("2018-12-11 10:40:00", "yyyy-MM-dd hh:mm:ss");//输入的时间
QDateTime utcDate = localDate.toTimeZone(zone);//拿到的是0时区的当前时间
QDateTime currentTime = QDateTime::currentDateTime();//当前时区的当前时间
QDateTime changeLocaldate = QDateTime::fromMSecsSinceEpoch(localDate.toMSecsSinceEpoch(), Qt::UTC);
QDateTime changeutcDate = changeLocaldate.toTimeZone(zone);
QTimeZone currentZone = currentTime.timeZone();
QString currentZoneId = currentZone.id();//当前时间的当前时区
QDateTime currentUtcTime = QDateTime::currentDateTimeUtc();//当前的UTC时间
ERROR_TRACE("Local Date: %s", localDate.toString().toUtf8().data());
ERROR_TRACE("utc Date: %s", utcDate.toString().toUtf8().data());
ERROR_TRACE("Current Date: %s", currentTime.toString().toUtf8().data());
ERROR_TRACE("change Current