i have a problem to convert a QString
to a QDataTime
-Object.
The String looks like: "2008:09:23 14:18:03
and have a length of 20.
The Problem is, if i remove the first character the output looks like: "008:09:23 14:18:03
.
That's wrong with it? Can i delete all characters without the numbers?
The code:
QDateTime date;
QString d=QString::fromStdString(result.val_string);
date.fromString(d,"yyyy:MM:dd hh:mm:ss");
qDebug()<<d;
qDebug()<<d.length()<<date.toString();
And the output:
"008:09:23 14:18:03
19 ""
Greetings