美文网首页
Qt 时间获取

Qt 时间获取

作者: 厝弧 | 来源:发表于2016-03-31 10:50 被阅读0次

Qt 时间获取

1. QDateTime

函数介绍:

QString QDateTime::toString ( const QString & format ) const

Returns the datetime as a string. The format parameter determines the format of the result string.

  • 日期示例:


    日期示例
  • 时间示例


    时间示例
  • 综合范例


    综合范例

示例代码

QDateTime time = QDateTime::currentDateTime();
QString str = time.toString("yyyy-MM-dd hh:mm:ss ddd");

相关文章

网友评论

      本文标题:Qt 时间获取

      本文链接:https://www.haomeiwen.com/subject/htuelttx.html