当前位置:网站首页>change system time
change system time
2022-06-10 13:00:00 【YQ8023family】
- Add administrator privileges to programs

- Code
//qint64 time_t1 = QDateTime::currentDateTime().toMSecsSinceEpoch();// return ms
qint64 time_t1 = 16520974000;
QDateTime datetime = QDateTime::fromMSecsSinceEpoch(time_t1);
SYSTEMTIME st = {0};
GetLocalTime(&st);
st.wYear = datetime.date().year();
st.wMonth = datetime.date().month();
st.wDay = datetime.date().day();
st.wHour = datetime.time().hour();
st.wMinute = datetime.time().minute();
st.wSecond = datetime.time().second();
st.wMilliseconds = datetime.time().msec();
bool state = SetLocalTime(&st); // Return if the modification is correct true
QDateTime time = QDateTime::currentDateTime();
qDebug() << time.toString("yyyy-MM-dd hh:mm:ss.zzz") << " state = " << state;
边栏推荐
- excel异步导出
- 2022 Zhejiang provincial competition
- eseses
- Vdo-slam source code reading notes [1] dynamic obj part in track()
- Offer has been made, advanced learning
- Can qiniu open an account? Can qiniu directly open the security of securities companies on the app
- UML class diagram
- 從解讀 BDC 自動生成的代碼談起,講解 SAPGUI 的程序組成部分
- Today, a couple won the largest e-commerce IPO in Hong Kong
- 20年技术老兵放弃大厂CTO头衔!这家创业公司凭什么吸引他?
猜你喜欢

Leetcode 96. Différents arbres de recherche binaires

Creating basic stacks and queues in C language

实战案例,深入剖析

JS click the button to slide to the left

微信web开发工具使用教程,公司开发web

Give root password for maintenace (or press Control-D to continue): solution

Stm32f407 clock tree and system clock learning notes

【FAQ】运动健康服务REST API接口使用过程中常见问题和解决方法总结

【移动机器人】轮式里程计原理

Qt数据库应用22-文件编码格式识别
随机推荐
In June, 2022, China Database ranking: tidb made a comeback to win the crown, and Dameng was dormant and won the flowers in May
How can the team be dissolved...
Learning of cc2642r Bluetooth MCU chip
JS translates Arabic numerals into Chinese capital figures, JS converts figures into capital amounts (sorting)
统计100以内的各位数之和为7的自然数的个数及平均值
Start with interpreting the code automatically generated by BDC, and explain the trial version of the program components of sapgui
CMakeLists.txt 如何编写
六石编程学:以文字处理的位置,谈谈命名
Slide the navigation fixed head upwards
Start with interpreting the code automatically generated by BDC, and explain the program components of sapgui
Creating basic stacks and queues in C language
Baidu programmers were sentenced to nine months for deleting the database. The one click unbinding function of the mobile phone number was released. Twitter compromised with musk again. Today, more bi
深度神经网络每秒分类近20亿张图像,新型类脑光学分类器芯片登上Nature
The ability to register user names and passwords with the database
今天,一对情侣拿下香港最大电商IPO
STM32 learning notes (2) -usart (basic application 1)
H5 pop up prompt layer - top, bottom, left and right center
Stm32f407 clock tree and system clock learning notes
MySQL service evolution
【Spark】(task8)SparkML中的pipeline通道建立