当前位置:网站首页>Mutual conversion between qstring and qdatetime
Mutual conversion between qstring and qdatetime
2022-06-24 02:29:00 【User 7108768】
QDateTime yes Qt Date time class commonly used in , We often convert it into QString type , Or reverse conversion , The specific method is as follows .
1、QDateTime Convert to QString
QString QDateTime::toString ( Qt::DateFormat format = Qt::TextDate ) const
QString strDate;QDateTime time;// Get the current time of the system time = QDateTime::currentTime();// In a fixed time format yyyy-MM-dd hh:mm:ss Save as string strDate = time.toString("yyyy-MM-dd hh:mm:ss"); 2、QString Convert to QDateTime
QDateTime QDateTime::fromString(const QString& string, const QString& format) [static]
// Define date QString dateContent = "2016-02-19 22:11:33" ; QDateTime time; time = QDateTime::fromString(dateContent, "yyyy-MM-dd hh:mm:ss");
边栏推荐
- [Tencent cloud double 12 audio and video communication special session] from 9 yuan for Q4 counter attack artifact, SMS and security (New) package!
- How to view the speech synthesis platform how to use the speech synthesis platform
- Grpc: adjust data transfer size limit
- How to design and make ppt gradient effect?
- Where is the domain name filed? What materials are required for domain name filing?
- Interesting talk about decorator mode, so you will never forget it
- Mysql Find_ IN_ Set function
- 5g Gigabit router dual band industrial grade
- What about registered domain names? How long does it take to register a domain name?
- Learning and life -- Talking about my learning methods
猜你喜欢

2020 language and intelligent technology competition was launched, and Baidu provided the largest Chinese data set

Introduction to development model + test model

Leetcode969: pancake sorting (medium, dynamic programming)

BIM model example

How to fill in and register e-mail, and open mass mailing software for free
Cloudpods golang practice

application. Yaml configuring multiple running environments

If there are enumerations in the entity object, the conversion of enumerations can be carried out with @jsonvalue and @enumvalue annotations

Advanced BOM tool intelligent packaging function

163 mailbox login portal display, enterprise mailbox computer version login portal
随机推荐
What is ITF barcode
Frequent screen flashing after VNC login - abnormal system time
Using robot framework to realize multi platform automated testing
Use cloudflare to defend against DDoS for free
What is a port? The most complete and strongest port number in history, collection!
IP address and subnet partition are very important. This article is very fragrant!
The United States offered 10million yuan to hunt down blackmail hackers and the energy industry became the "hardest hit" of phishing attacks | global network security hotspot
Layout use case
How to design and make ppt gradient effect?
Thoroughly explain the details of the simple factory that you haven't paid attention to
Is it illegal to use someone else's trademark to register a domain name? What should we pay attention to when registering a domain name?
What is the industrial Internet? What is the industrial Internet platform?
Pan micro reached cooperation with Tencent to help enterprises connect with banking services and support enterprise digital upgrading
How to build a website? What needs attention?
Hungry? Remote dual live database practice
How to protect your code - ollvm (1)
What is vxlan? What are its advantages?
What is the large bandwidth of IDC machine room?
Engineer culture: why doesn't bat call the boss
Tencent cloud double 11 Live Room activity rules