原文地址::http://blog.csdn.net/philosophyatmath/article/details/41803111
相关文章
1、Qt 获取当前时间----http://blog.csdn.net/lusirking/article/details/51460716
- QDateTime dt;
- QTime time;
- QDate date;
- dt.setTime(time.currentTime());
- dt.setDate(date.currentDate());
- QString currentDate = dt.toString("yyyy:MM:dd:hh:mm:ss");
- qDebug()<<currentDate<<"-=-=-=-=-=-=-=-";
-
- QDateTime current_date_time = QDateTime::currentDateTime();
- QString current_date = current_date_time.toString("yyyy-MM-dd hh:mm:ss ddd");
-
- qDebug()<<current_date<<"-=-=-=-=-=-=-=-";