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. [Solved]Number of months between two Dates
Qt 6.11 is out! See what's new in the release blog

[Solved]Number of months between two Dates

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.0k 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.
  • S Offline
    S Offline
    starFire
    wrote on last edited by
    #1

    Hello,
    Is there any way to get the number of months between two Dates?
    eg I have the date (QDate) 11/20/2013 and the date 01/16/2014 i want to know that the number of months to the second date is 2.
    Is there any function or method?
    I only could find daysTo but thats not what I need.
    thanks

    1 Reply Last reply
    1
    • V Offline
      V Offline
      vezprog
      wrote on last edited by
      #2

      Just found this:
      http://qt-project.org/forums/viewthread/9812

      QTimeSpan looks like it will do what you need.

      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