QDateTime::currentDateTimeUtc().toTime_t()
获得的时间是0时区的时间,也就是说比北京时间早8个小时(北京是8区)
下面可以获得电脑当前的时区正确时间值。
date_time=QDateTime::fromTime_t( QDateTime::currentDateTimeUtc().toTime_t() );
date_time.setTimeSpec(Qt::UTC);
//QString str = date_time.toString("yyyy/MM/dd hh:mm"); //qDebug()<<"------------------- "<< str;
quint32 nowtime = date_time.toTime_t()