#include <QtCore/QCoreApplication>
#include <QtCore/QDateTime>
#include <qDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
//qDebug() << QDateTime(QDate(1970, 1, 1), QTime(8, 0, 3) /* , Qt::LocalTime */).toTime_t(); //输出3;因为系统是东八区的
//qDebug() << QDateTime(QDate(1970, 1, 1), QTime(1, 0, 3), Qt::UTC).toTime_t(); //输出3603;使用格林时间
const int LOCAL_TIME_ZONE = 24 - QDateTime(QDate(1970,1,2), QTime(0,0,0), Qt::LocalTime).toTime_t() / 3600;
qDebug() << LOCAL_TIME_ZONE;
return a.exec();
}