Find the answer to your Linux question:
Results 1 to 2 of 2
Hi Guys? I need help with a certain program. I have to write a program to perform date arithmetic, such as how many days there are between 6/1/90 and 8/3/92. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    jcs
    jcs is offline
    Just Joined!
    Join Date
    Jul 2008
    Posts
    9

    Smile Date Arithmetic


    Hi Guys?

    I need help with a certain program. I have to write a program to perform date arithmetic, such as how many days there are between 6/1/90 and 8/3/92. And I have to inlcude specification and code design.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,454
    First, convert the date to julian format (just a big number), do the date arithmetic, and convert back to a normalized date value. This algorithm from the Wikipedia works: Julian day - Wikipedia, the free encyclopedia
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •