# What date will it be?

1. Jan 29, 2014

### rhimmelblau

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. Jan 29, 2014

### Bacle2

Just work Mod7 .

3. Jan 29, 2014

### Mentallic

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?

4. Jan 29, 2014

### rhimmelblau

Looking for a algorithm I could punch in to my calculator or include in a piece of code.

5. Jan 29, 2014

### Mentallic

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

6. Jan 30, 2014

### SteamKing

Staff Emeritus
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