QT获取系统当前时间

来源:互联网 发布:软件安全测试方法 编辑:程序博客网 时间:2024/05/21 17:43
QDateTime time = QDateTime::currentDateTime();          //获取系统现在的时间

QString str = time.toString("yyyy-MM-dd hh:mm:ss ddd");             //设置显示格式

label->setText(str);          //在标签上显示时间
原创粉丝点击