当前位置:网站首页>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");
边栏推荐
- What are the conditions for trademark registration? How long does it take to register a trademark?
- 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
- Does the cloud game server only provide one player? Cloud game server defense capability
- How to improve the success rate of trademark registration? How long does it take to register a trademark?
- Leetcode problem solving notes for slow ploughing of stupid cattle (dynamic update...)
- A variety of fixed assets inventory methods to deal with the year-end large inventory of fixed assets
- Why do cloud desktops use rack servers? What are the functions of cloud desktop?
- Set multiple print for batch generated barcodes
- How to bind EIP to access public network in tke cluster fixed IP mode pod
- Initial experience of creating partitioned tables under MySQL cases tdsql for MySQL (I)
猜你喜欢

application. Yaml configuring multiple running environments

163 mailbox login portal display, enterprise mailbox computer version login portal

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

Advanced BOM tool intelligent packaging function

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

Introduction to development model + test model

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

BIM model example

Leetcode969: pancake sorting (medium, dynamic programming)
随机推荐
Coding -- the leader of R & D tools in the cloud native Era
In PHP, use recursive depth to merge multiple arrays
How to build a website? What needs attention?
How does easynvr call the interface to modify a user-defined page?
How to build video websites? What are the types of video websites?
Start tcapulusdb process
The cloud University of "digital and real integration, CO building authentic Internet" is surging forward
How to build a video website? How much does it cost to build a video website?
Network engineers must know the 10 technical points of IPv6. It is recommended to collect them!
How to register a trademark? How to improve the passing rate of trademark registration?
Question: can you get download the resources of Baidu online disk?
Mainstay of network detection - nping User Guide
Buddha's foot before examination: the third bullet of leetcode
Centeros environment setup
Shopify has quietly taken the second place in e-commerce in North America. Is independent station the "magic weapon" to win?
Select problem set 3
Looking at the future development direction of industrial Internet from the transformation of circulation links of large building materials
Learning and life -- Talking about my learning methods
An attempt to use Navicat tool to copy and export MySQL database data
Facebook was officially renamed meta, and the digital twin meta universe was applied!