Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Get next day QDate
Forum Updated to NodeBB v4.3 + New Features

Get next day QDate

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alexandros
    wrote on last edited by
    #1

    Hello!
    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...

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      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

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved