QDate::daysTo but only with yyyy-MM-dd
Well i’m trying to use QDate::daysTo to check the difference between 2 dates. But daysTo param accepts a QDate, but QDate returns: QDate(“sun feb 19 2012”)
In easy words.
I want QDate to only return yyyy-MM-dd and not QDate(“sun feb 19 2012”) (Today…) something like.. .QDate(“2012-02-19”) so i can easily do:
7 replies
Sorry, what i’m trying to do is to check how many days until a date. I mean, i have 2012-02-20 (20 February 2012). I want to count how many days until today (Since today is 25, 5 days).
EDIT: Okay, i’ve got it. Was something like creating a TempDate and doing QDate::fromString(“2012-02-20”, “yyyy-MM-dd”) then doing temp.daysTo(QDate::currentDate)
You must log in to post a reply. Not a member yet? Register here!



