QDateTime for QString with milliseconds in Qt3

Is there a way in Qt3 to convert a QDateTime to a QString and go back to QDateTime, so that ultimately QDateTime will contain millisecond information?

Thanks.

+4
source share
2 answers

Use the toString function. The format parameter determines the format of the result string.

For example, the following code will return only seconds and milliseconds.

 QDateTime t = QDateTime::currentDateTime (); QString s = t.toString("ss:zzz"); 

PS. You should consider porting code to Qt4

+6
source
 QString DataList[100][100] ; QDateTime AwbDateTime ; AwbDateTime = QDateTime::fromString(DataList[i][9].left(19),Qt::ISODate) ; 

This works fine in Qt3

0
source

Source: https://habr.com/ru/post/1391291/


All Articles