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. Help

Help

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    can anyone tell me to create a program that can tell the difference between to dates. Even leap years? I really need help. I have been trying to do it for the past two weeks and I still get errors.

    M C M 3 Replies Last reply
    0
    • L Lost User

      can anyone tell me to create a program that can tell the difference between to dates. Even leap years? I really need help. I have been trying to do it for the past two weeks and I still get errors.

      M Offline
      M Offline
      Mike Danberg
      wrote on last edited by
      #2

      Helps to post exactly what you're having problems with.

      1 Reply Last reply
      0
      • L Lost User

        can anyone tell me to create a program that can tell the difference between to dates. Even leap years? I really need help. I have been trying to do it for the past two weeks and I still get errors.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Would this be your homework ? If you've been trying for two weeks, you must have some code you can post ? Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

        1 Reply Last reply
        0
        • L Lost User

          can anyone tell me to create a program that can tell the difference between to dates. Even leap years? I really need help. I have been trying to do it for the past two weeks and I still get errors.

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          The normal approach is to convert the dates into some numeric format, from which you can then perform the subtraction and convert back to days, weeks etc. In Windows you would normally set up a SYSTEMTIME structure, convert it to a FILETIME with SystemTimeToFileTime, copy the two parts of FILETIME into a LARGE_INTEGER, then do 64-bit arithmetic on the QuadPart member. A FILETIME is in 100ns (0.1us, or 1 x 10 ^ -7 s) intervals. If the code needs to be portable (e.g. to work on Unixes) you might prefer looking at the C standard library routines, the tm structure and the time_t numeric type.

          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