Days between dates

Enter first date: cal.
Enter second date: cal.  
Select date format:
English Danish Java Java


  1. Month and day may be one or two digits. The year may be one to four digits. One and two digit years are assumed to be 20th century AD. So if the date is first century, use leading zeros, like "0064" for the year Rome burned during Nero's reign.
  2. The script will pop up an alert box and mark the days between dates as questionable if a date is invalid. Leap year checking is correct for both Gregorian (after 15 Oct 1582) and Julian (before) dates, except for dates before 8 A.D. From 45 B.C. to 8 A.D. leap years followed a different rule, and the current version of this script does not account for that.
  3. In the Julian-to-Gregorian change, 15 Oct immediately followed 4 Oct 1582. The script will not allow you to use dates in that time period, because they do not exist in countries that implemented the Gregorian calendar on the prescribed date. For other countries you're on your own.
  4. If you correct a date you must remember to re-calculate the days between dates for it to be valid.
  5. The calculation script uses Javascript 1.2. If interested, use "view source" in your browser to see the Javascript source code.
  6. The script calculates the difference between Julian days, so it should be accurate from 1 Jan 4713 BC (Julian day zero) to 1 Jan 3268. This is from before Abraham left Ur to after the millenial reign of Christ, so it should be quite sufficient. Dates on or after 15 Oct 1582 are assumed to be in the Gregorian calendar, and dates before that in the Julian calendar.
  7. Thanks to Claus Tøndering ( for detailed information about the Christian calendar and Julian day algorithms.
  8. This page previously used the Javascript Date object. To my suprise, I found that it, and the Java Date and Calendar classes are all buggy--they believe that April has 29 days. Click here for Java source code that demonstrates the bug.
  9. Thanks to Jørgen Staal for the Danish translation.
  10. If you find errors, please forgive me and send me a note.

Last revised 3/21/2008
M. Steven Evans [ mail | home page ]