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. VC++ Date/Time calculation

VC++ Date/Time calculation

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
4 Posts 2 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.
  • J Offline
    J Offline
    JoeMass
    wrote on last edited by
    #1

    I am using the VC++ date/time picker control. I want to select a date and then calculate the total seconds from 01-Jan-1980 until the selected date. Also I want to store this as an unsigned long int. Do you know of a simply way to do this?

    D 1 Reply Last reply
    0
    • J JoeMass

      I am using the VC++ date/time picker control. I want to select a date and then calculate the total seconds from 01-Jan-1980 until the selected date. Also I want to store this as an unsigned long int. Do you know of a simply way to do this?

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Store each of the dates in a COleDateTime object. Assign the difference to a COleDateTimeSpan object.


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      J 1 Reply Last reply
      0
      • D David Crow

        Store each of the dates in a COleDateTime object. Assign the difference to a COleDateTimeSpan object.


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        J Offline
        J Offline
        JoeMass
        wrote on last edited by
        #3

        I have very little VC++ experience. Could you give me more details on how to do this? thank you

        D 1 Reply Last reply
        0
        • J JoeMass

          I have very little VC++ experience. Could you give me more details on how to do this? thank you

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Yes, but I'd rather point you here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/\_mfc\_cdatetimectrl.3a3a.gettime.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/\_mfc\_coledatetime.asp http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/\_mfc\_coledatetimespan.asp


          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

          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