Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: Date Arithmetic

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    12,450
    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
  •