首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

QT应用编程: 获取系统当前时间以及1970到现在的总秒数

一、环境介绍 操作系统介绍:win10 64位 QT版本: 5.12.6 二、获取系统当前时间 2.1 获取当前系统的时间日期 QDateTime current_date_time =QDateTime...currentDateTime(); QString current_date =current_date_time.toString("yyyy.MM.dd hh:mm:ss.zzz ddd"); 2.2 获取当前系统的时间...当前的分 int second = current_time.second();//当前的秒 int msec = current_time.msec();//当前的毫秒 2.3 获取1970年到现在的秒数...获取格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总秒数 //秒级时间戳(十位) QString timestamp = QString...::number(QDateTime::currentMSecsSinceEpoch() / 1000); //毫秒级时间戳(十三位) QString timestamp = QString::number

1.3K30
领券