Solved How convert time in string to QDateTime
-
here the string i got from server :
2019-03-12T03:24:30.282Z
how to convert this to Qdatetime, i try
QDateTime time = QDateTime::fromString("2019-03-12T03:24:30.282Z","yyyy-MM-ddTHH_mm_ss.zzzZ");
but result invalid
-
Hm, your code should work, it's correct.
Try this:
QDateTime time = QDateTime::fromString("2019-03-12T03:24:30.282Z", Qt::ISODateWithMs);
-
@sierdzio said in How convert time in string to QDateTime:
Hm, your code should work, it's correct.
Huh, nope I read it wrongly. You've mixed the characters a bit.
QDateTime time = QDateTime::fromString("2019-03-12T03:24:30.282Z","yyyy-MM-ddTHH:mm:ss.zzzZ");
-
@sierdzio
Qt::ISODateWithMs is worked
ty, you save my day