10-28-2013 08:06 AM
I need to extract the date from the file name.
What i m doing is :
QString fileName = "logs_2013_15_07.txt" ;
QDate fileDate = QDate::fromString(fileName," 'logs_'yyyy'_'MM'_'dd'.txt' ") ;
qDebug() << fileDate ;
following the example in the doc:
QDateTime dateTime2 = QDateTime::fromString("M1d1y9800:01:02", "'M'M'd'd'y'yyhh:mm:ss"); // dateTime is 1 January 1998 00:01:02
but i get invalid date.
is there anything i m missing??
10-28-2013 11:06 AM
My first guess would be the spaces between the double quote and single quote characters, but I haven't tried it. You might have more luck setting your format string to be