Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Get next day QDate
alexandros last edited by
I am making a QString in the format: YYMMDDHHmm
(year-month-day of year-hour of day(24 hours format)-minute of hour)
But I would like to take the next day from today. For example, if today is
20123911515 (2012, 3 (March), 91th day of the year (31 of march), and its 15:15)
then I will need
20124921515 (i will need to change both the month and the day of the year, because today is the last day of the month)
So, the main problem is, how will I detect that today is the last day of the current month? Also, more problems arise with leap years.
Is there a safe way to take the next day's date with the above format?
Thanks in advance for any answers...
koahnig last edited by
QDate has a method call "addDays":http://qt-project.org/doc/qt-4.8/qdate.html#addDays
Also QDateTime has "this method ":http://qt-project.org/doc/qt-4.8/qdatetime.html#addDays