Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. add int to date

add int to date

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialcsharpc++question
4 Posts 3 Posters 0 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.
  • T Offline
    T Offline
    Try
    wrote on last edited by
    #1

    Hi All, Using VC++, i want to add integer value to date. For example: date is 17/12/2007, if i add 365 days to this date, the result should be 16/12/2008. AddDays() function is available in .Net. How to do it using VC++ 6.0?

    CPalliniC M T 3 Replies Last reply
    0
    • T Try

      Hi All, Using VC++, i want to add integer value to date. For example: date is 17/12/2007, if i add 365 days to this date, the result should be 16/12/2008. AddDays() function is available in .Net. How to do it using VC++ 6.0?

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      What is your date variable type?

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • T Try

        Hi All, Using VC++, i want to add integer value to date. For example: date is 17/12/2007, if i add 365 days to this date, the result should be 16/12/2008. AddDays() function is available in .Net. How to do it using VC++ 6.0?

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        what about CTime and CTimeSpan ?


        Maximilien Lincourt Your Head A Splode - Strong Bad

        1 Reply Last reply
        0
        • T Try

          Hi All, Using VC++, i want to add integer value to date. For example: date is 17/12/2007, if i add 365 days to this date, the result should be 16/12/2008. AddDays() function is available in .Net. How to do it using VC++ 6.0?

          T Offline
          T Offline
          Try
          wrote on last edited by
          #4

          Thank you, i got the soln I am using COleDateTime and COleDateTimeSpan. COleDateTime d; COleDateTimeSpan s(2,0,0,0); d::GetCurrentTime(); d = d + s;

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups