I need to get date and time of received and sent messages . I used deviceTimestamp() method of Message class but this returns obj of QDateTime but I want this in String . So could anyone please tell me how should I do this or any other way of getting message time and date ?
Asked
Active
Viewed 199 times
1 Answers
2
Once you obtain your QDateTime, can't use the toString() method?
https://qt-project.org/doc/qt-5.0/qtcore/qdatetime.html#toString
QString dateString = yourQDateTime.toString("MM-dd-yyyy hh:mm");

bh42
- 115
- 6