QT如何获取当前时间
发布网友
发布时间:2022-04-27 09:53
我来回答
共3个回答
热心网友
时间:2023-10-16 16:05
QTime QTime::currentTime () [static]
This is an overloaded member function, provided for convenience.
Returns the current time as reported by the system clock.
Note that the accuracy depends on the accuracy of the underlying operating system; not all systems provide 1-millisecond accuracy.
----------------------------------------------------------------------------------------------------------------
int QTime::msec () const
Returns the millisecond part (0 to 999) of the time.
See also hour(), minute(), and second().
----------------------------------------------------------------------------------------------------------------
多用用的Qt的帮助文档程序Assitant,很有用的 qthelp://com.trolltech.qt.451/qdoc/qtime.html#currentTime追问如何使用啊
热心网友
时间:2023-10-16 16:05
QTime类中有一个函数currentTime(),就是获取当前时间
QTime::currentTime().hour()获取当前小时
QTime::currentTime().minute()获取当前分钟
QTime::currentTime().second()获取当前秒钟
热心网友
时间:2023-10-16 16:06
就是正常使用啊,你用QtCreater打开帮助可以看到 QTime的帮助文档,然后就啥都会了