LaurentDuroisin
19th January 2016, 09:21
Hi!
I enter a date in this format : d/MM/yyyy
So, I just set up the date like this :
QStringList sList = date.split("/");
QDate date = QDate::fromString(sList.at(0)+"MM"+sList.at(1)+"yyyy"+sList.at(2), "d'MM'yyyy");
But there is a problem when I want to compare dates :
if (date.toString("d'MM'yyyy") == finfo.lastModified().toString("d'MM'yyyy")) {
//Some code.
}
It doesn't enter into the if,
I enter a date in this format : d/MM/yyyy
So, I just set up the date like this :
QStringList sList = date.split("/");
QDate date = QDate::fromString(sList.at(0)+"MM"+sList.at(1)+"yyyy"+sList.at(2), "d'MM'yyyy");
But there is a problem when I want to compare dates :
if (date.toString("d'MM'yyyy") == finfo.lastModified().toString("d'MM'yyyy")) {
//Some code.
}
It doesn't enter into the if,