Stanfillirenfro
31st March 2014, 12:44
Hi!
I am struggling right now with the conversion of a string to a date, but I am not succeeding. Could someone help?
My string is in the following format:
Sa Feb 22 2014.
After compiling, qDebug prints an empty QDate (
QDate(""))
I have the following code:
QString strDate1, strDate2;
QDate strDate;
strDate1 = Sa Feb 22 2014;
strDate2 = QString::fromStdString(strDate1.toStdString());
strDate.fromString(strDate2, "dd mmm ww yyyy");
Many thanks in advance
I am struggling right now with the conversion of a string to a date, but I am not succeeding. Could someone help?
My string is in the following format:
Sa Feb 22 2014.
After compiling, qDebug prints an empty QDate (
QDate(""))
I have the following code:
QString strDate1, strDate2;
QDate strDate;
strDate1 = Sa Feb 22 2014;
strDate2 = QString::fromStdString(strDate1.toStdString());
strDate.fromString(strDate2, "dd mmm ww yyyy");
Many thanks in advance