当前位置:网站首页>Common date formatter and QT method for obtaining current time
Common date formatter and QT method for obtaining current time
2022-06-24 08:30:00 【Pepsi__】
Common date formatter and its meaning :
character | significance |
---|---|
yy | year , Two digit display ,00-99 |
yyyy | year , Four digit display , Such as 2016 |
M | month , Display without zero padding ,1-12 |
MM | month , Zero filling display ,01-12 |
d | God , Display without zero padding ,1-31 |
dd | God , Zero filling display ,01-31 |
h | Hours , No zeros ,0-23 or 1-12( If it shows AM/PM) |
hh | Hours , Zero compensation 2 Bit display ,00-23 or 01-12( If it shows AM/PM) |
H | Hours , No zeros ,0-23 or 1-12( Even if it shows AM/PM) |
HH | Hours , Zero compensation 2 Bit display ,00-23 or 01-12( Even if it shows AM/PM) |
m | minute , No zeros ,0-59 |
mm | minute , Zero filling display ,00-59 |
z | millisecond , No zeros ,0-999 |
zzz | millisecond , Zero compensation 3 Bit display ,000-999 |
AP or A | Use AM/PM Show |
ap or a | Use am/pm Show |
Text conversion date :
QDateTime dateTime = QDateTime::fromString("2022/06/23 23:05:24","yyyy/MM/dd hh:mm:ss");
Date conversion text :
QString timeStr = QDateTime::currentDateTime().toString("yyyy year MM month dd Japan hh when mm branch ss second ");
QString timeStr1 = dateTime.toString("yyyy year MM month dd Japan hh when mm branch ss second ");
边栏推荐
- 问题4 — DatePicker日期选择器,2个日期选择器(开始、结束日期)的禁用
- [ACNOI2022]不是构造,胜似构造
- js滚动div滚动条到底部
- Future trends in automated testing
- QTimer定时器不起作用的原因
- ZUCC_ Principles of compiling language and compilation_ Experiment 05 regular expression, finite automata, lexical analysis
- os. path. Pits encountered during the use of join()
- Take my brother to do the project. It's cold
- 【微服务~Nacos】Nacos服务提供者和服务消费者
- PAT 1157:校庆
猜你喜欢
2022 mobile crane driver special operation certificate examination question bank and online simulation examination
ZUCC_编译语言原理与编译_实验03 编译器入门
The article takes you to understand the security of Windows operating system and protect your computer from infringement
12-- merge two ordered linked lists
About the iframe anchor, the anchor is offset up and down, and the anchor has page display problems Srcdoc problem of iframe
权限模型 DAC ACL RBAC ABAC
Swift 基礎 閉包/Block的使用(源碼)
FPGA的虚拟时钟如何使用?
jwt(json web token)
Utilisation de la fermeture / bloc de base SWIFT (source)
随机推荐
Chart list Performance Optimization: minimum resource consumption in the visualization area
Transformers pretrainedtokenizer class
【毕业季】你好陌生人,这是一封粉色信笺
ZUCC_编译语言原理与编译_实验02 FSharp OCaml语言
自动化测试的未来趋势
3D数学基础[十七] 平方反比定理
[ACNOI2022]不是构造,胜似构造
"Wechat cloud hosting" first practical battle | introduction to minimalist demo
Detailed explanation of etcd backup and recovery principle and actual record of stepping on the pit
[acnoi2022] I have done it, but I can't
常用日期格式符与Qt获取当前时间的办法
AUTO PWN
5分钟,客服聊天处理技巧,炉火纯青
The JS macro of WPS implements the separation method of picture text in the same paragraph
Swift 基礎 閉包/Block的使用(源碼)
Swift foundation features unique to swift
Small sample fault diagnosis - attention mechanism code - Implementation of bigru code parsing
2022 mobile crane driver special operation certificate examination question bank and online simulation examination
487. 最大连续1的个数 II ●●
Permission model DAC ACL RBAC ABAC