QT 获取系统时间

1.导入QTime

#include <QTime>

2.定义QTime 对象接受当前时间

QTime t=QTime::currentTime();

t就是系统时间。

3.将t转化为string类型输出

 QString text=t.toString("HH:mm:ss");

猜你喜欢

转载自www.cnblogs.com/fuhang/p/9888434.html