1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What date will it be?

  1. Jan 29, 2014 #1
    Is there a formula to calculate what date it will be in a certain number of days? I've tried to work this out on my own but don't know what to do with those pesky leap years.

    Say you figured out that a comet you want to see will have its closets approach to earth again in 50,000 days, and you want to mark it on your calendar.
     
  2. jcsd
  3. Jan 29, 2014 #2

    Bacle2

    User Avatar
    Science Advisor

    Just work Mod7 .
     
  4. Jan 29, 2014 #3

    Mentallic

    User Avatar
    Homework Helper

    You should read the wiki on leap years since it's a little more complicated than just adding a day every 4th year.

    Also, are you looking for an algorithm (what calculators would probably use) to find the date, or do you want an actual formula which I'd have to admit would be more complicated?
     
  5. Jan 29, 2014 #4
    Looking for a algorithm I could punch in to my calculator or include in a piece of code.
     
  6. Jan 29, 2014 #5

    Mentallic

    User Avatar
    Homework Helper

    Alright well it's not too hard to deal with leap years. Basically, it's a leap year every 4 years, except every century (not including every 400 years).
     
  7. Jan 30, 2014 #6

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    For the Gregorian calendar, a year is a leap year if it is evenly divisible by 4, except in the case of century years (which end in '00'), which must be evenly divisible by 400. Thus, 2000 was a leap year while 1900 was not and 2100 will not be.

    http://en.wikipedia.org/wiki/Gregorian_calendar

    This paper describes some algorithms for calendrical calculations:

    http://www.cs.tau.ac.il/~nachumd/papers/cc-paper.pdf

    Most spreadsheets like Excel include date calculating functions built in. In any event, most of these routines use Julian date calculations, where each date on the calendar has a unique integer, called a Julian Day Number (JDN), associated with it.

    http://en.wikipedia.org/wiki/Julian_day
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: What date will it be?
  1. WHat is this? (Replies: 9)

  2. What is ^? (Replies: 2)

Loading...