QDateTime time = QDateTime::currentDateTime();//获取系统现在的时间 QString str = time.toString("yyyy-MM-dd hh:mm:ss ddd"); //设置显示格式 label->setText(str);//在标签上显示时间
QT获取系统时间,以及设置日期格式
最新推荐文章于 2024-07-03 00:11:08 发布
QDateTime time = QDateTime::currentDateTime();//获取系统现在的时间 QString str = time.toString("yyyy-MM-dd hh:mm:ss ddd"); //设置显示格式 label->setText(str);//在标签上显示时间