Time and the Hour Running Through Rough DaysThere is a relatively simple algorithm to calculate the lapsed time between any two dates expressed in terms of the standard European calendar and GMT...Bill Casselman
I was born in the state of New Jersey on November 27, 1941 at 2:00 AM. Nasty question. The most straightforward way to answer it is very simple if somewhat tedious  make up a table of the different time periods involved, reduced to a single unit of time in a single time zone. For the unit of time I'll choose the day, and for the time zone I'll choose Greenwich Mean Time, for many years a kind of universal time on earth. GMT is 5 hours ahead of Eastern Standard Time and 7 ahead of Pacific Daylight Time, so I was born at 7 AM (GMT) and it is now 9 PM (GMT). We now add together
The table runs
making a total of This is not only somewhat tedious, it is just complicated enough to be prone to error. For short periods it can be done on a spreadsheet, laid out more or less as the table indicates. There is one mildly interesting mathematical question that arises  is there a good spreadsheet formula for calculating the length of a year? In the Gregorian calendar, the number of days in most years is 365, but very fourth year is a leap year with 366  except that years which are multiples of 100 are not leap years  except that years which are divisible by 400 are leap years. So 2000 is a leap yearthe only exceptional thing about the year 2000 is that it is not exceptional! Another mildly annoying feature of the Gregorian calendar is that the number of days in a month varies rather erratically, so calculating the time elapsed between one day of the year and another is a bit painful. These observations make it all the more remarkable that there is a relatively simple algorithm to calculate the lapsed time between any two dates expressed in terms of the standard European calendar and GMT. Suppose a date is given in year, month, day format, expressed numerically. Let these be Y, M, D in numbers, where M ranges from 1 to 12) and The algorithmHow does one calculate the Julian Day Number? I give here a slight modification of the method presented in Wikipedia, which I shall then explain. It works only for dates subsequent to 4800 B. C., but this is hardly a serious restriction since after all no dates were recorded anywhere on the planet before then. In Western culture since the early middle ages, there have been two calendars widely used, the Julian and the Gregorian. The Julian calendar was in important aspects the one put into place by Julius Caesar. It assumed a year of length 365.25 days, which was a bit longer than the true one of approximately 365.2422 days. It was used more or less continuously for more than a millennium, but as time went on it was realized that the date on which certain events happened, such as the equinoxes, were not what they had been in Roman times. For this reason it was replaced by the Gregorian calendar, which was much more accurate. In much of Europe the new one was put into place at midnight on October 4, 1582, so that the following day was October 15! It took a long time before the rest of Europe accepted the new scheme. It wasn't until 1752 that England adopted the Gregorian calendar, which it called New Style as opposed to Old Style. September 2, 1752 (O.S.) was followed by September 14 (N.S.). Because the Middle Ages recorded dates in the Julian calendar, it is conventional to use the Julian calendar through October 4, 1582 and the Gregorian one after that, although in accounts of English history through the 18th century dates are often recorded in both forms, the Julian calendar in which English contemporaries recorded them as well as the Gregorian calendar in which the French (among others on the Continent) did so. Therefore, the algorithm has to deal with two separate cases, depending on whether the date is given according to the Julian or the Gregorian calendar. Suppose the date is given as
Here For a Gregorian date the Julian day is then while for a Julian date it is To see how it works, for my birthday we get
and similarly for today What the terms meanLet's look at each of the steps in the calculation. (1) Set
If This part of the formula has historical roots. In effect, January and February become the last months (10 and 11) of the previous year, so we are introducing a new calendar, one in which the first day of the year is March 1 instead of January 1. This is a good idea mathematically, since in this new calendar February, the only month with a variable number of days, is last. Hence the number of days from the start of the year to a given date does not depend on the year, as it does in our own calendar. This is such a great idea that you might wonder why it hasn't been done before! Now our calendar is derived from the Roman one, later amended in a first version by Julius Caesar and then in a second by Augustus. In the original Roman calendar, the beginning of the year was indeed March 1. There are still traces of this in our current calendar, because the names of the months September, October, November, and December are cognate with the Latin numbers 7, 8, 9, 10. It was Julius Caesar who made January the first month. On the other hand, though, it was also he who decreed that the variable day occurs in February. One never knows, do one? (2) If the date is October 4, 1582 or earlier (when the Julian calendar was in effect), set The ancient Roman calendar was chaotic. Julius Caesar, acting according to Pliny the Elder with the advice of the Alexandrian mathematician Sosigenes, reformed it in about 46 B.C. The main effect was to bring the length of the calendar year into better synchronization with the true length of a solar year. Since the number of days in a solar year is not an integer, in order to maintain this synchronization the length of a calendar year must vary from time to time. In the Julian calendar, three out of every four years had 365 days and the fourth year 366. The Julian calendar, in effect, assumes the true length of a solar year (say from vernal equinox to vernal equinox) to be 365.25 days. This is not correct, and overshoots the mark a bit, since the true solar year is very close to 365.2422 days. Even in Roman times the better estimate of 365.2467 days was known to experts, and I have not seen any explanation of why the Julian scheme was accepted when it was known not to be as accurate as it might have been. By the year 1500 or so, it was obvious to anybody who knew his history that the date of the vernal equinox, which is a natural event to use for recording annual periodicity, was about 10 days later than it had been in Roman times. After a great deal of discussion, Pope Gregory XIII, acting with the advice of several Jesuit mathematicians and astronomers, decreed that a change would be made official. In Catholic Europe, the next day after October 4, 1582 was October 15. In the rest of Europe this reform was apparently considered an attempt by the Roman Catholic Church to subvert the true order of things, and in effect to steal days away from people. There seems even to have been current a common opinion that they were days removed permanently from one's life span. The change was, however, adopted gradually by the rest of Europe over a period of several centuriesby England in the middle of the 18th century, by Russia only after the revolution of 1917. Pope Gregory's decree arranged that the dates of the equinoxes would agree with those of ancient times, but it also modified the Julian scheme of leap years in order to maintain synchronization. Every 100th year would not be a leap year, except that every fourth century break would be. Thus 1600 and 2000 were leap years in the Gregorian scheme, while 1700, 1800, and 1900 were not. This amounts to estimating the year at 364.2425 days long. In our shifted calendar, these numbers must be moved back one year, so that year The number (3) Add
In other words, the number (4) Add The Julian day starts at noon. This number is the number of days elapsed since the beginning of the current month. (5) Subtract either These numbers differ by The point of these subtractions is to set the origin of the calendars. The date now settled on as the origin of the Julian Day numeration was chosen for historical and religious reasons by Joseph Scaliger in the 16th century to be January 1, 4713 B. C. This somewhat arbitrary choice was made by the Scaliger on the basis of some arithmetic combining three cycles each of several years in lengththe Julian cycle, in which days of the week repeat every 28 Julian years, the Metonic cycle, which measures an approximate cycle of the relative positions of the sun and the moon (which determine the occurrence of Easter in the Roman Catholic Church), and the indictio, a period important in Roman tax administration. For simple arithmetical reasons, the combination of these cycles forced the starting date of the new Julian reckoning to be January 1, 4713 B.C. The details can be found in the book by Otto Neugebauer listed among the references. This scheme is surely one of the first examples of "legacy code," but it is probably still used in modern astronomy because essentially all astronomical data originated after Julian date 0. (The 11th edition of the Encyclopaedia Britannica asserts that Joseph Scaliger was the most famous scholar of all time! So fickle is fame.) Approximating sequences by formulaThe number of days This is the solution in this particular case of a more general problem: Which empirically given functions In this particular case, the function we are calculating is given by the table we have seen above. I repeat the part of the table we need:
As the third row of this table shows, we can write
What the graph shows is that
So our graph must pass between lower and upper stairs. But a line will lie above the lower stairs precisely when it lies above the lower region pictured below, and similarly it will lie below the upper stairs when it lies below the upper region in the picture. These are known as the convex hulls of the stairs, and they are easy to construct. So our straight line exists lying between the upper and lower stairs precisely when there is a gap between the two convex hulls, as there is here. And any line passing from There is a simple procedure for finding convex hulls in two dimensions, but here it would be quite feasible to find a line with a ruler and pen.
Describing all possible linesWe don't have to rely on the human eye to find possible values of
Each of the intervals gives rise to a condition on
Each of these describes a region in the two dimensional plane in which
The figure on the left shows where both these conditions are satisfied, and the one on the right shows where in addition
... and here we add the conditions
What we see is that the final region of all allowable
In other words, the region of allowable ConvexityLet me summarize. We are given an integer sequence In two dimensions there is a simple solution. Adding one inequality after the other, one has to deal with this problem: Given a polygon with vertices
The solution is to traverse the vertices and record where the line is crossed. Augustun dazeThe original calendar proposed by Julius Caesar was considerably more rational than the one we now use. The month of August (which was called Sextilis in those days before Augustus became emperor, as July had been called Quintilis before Julius came along) had 30 days, September had 31, and so on in alternation. The formula for calculating the number of days elapsed from March 1 was then very simple. But the month of July was dedicated to Julius Caesar, and when in turn the month of August came by decree to be dedicated to his successor Augustus, it was insisted that August be as long as July. A day was stolen from February, and then the alternation of sizes was changed to make September shorter than August, and alternating 31/30 from that month on. It's not very amazing that these changes took place, but rather more amazing that we still live with the minor annoyances the vanity of a Roman emperor created. To find out more
Bill Casselman Those who can access JSTOR can find some of the papers mentioned above there. For those with access, the American Mathematical Society's MathSciNet can be used to get additional bibliographic information and reviews of some these materials. Some of the items above can be accessed via the ACM Portal , which also provides bibliographic services. 
Welcome to the These web essays are designed for those who have already discovered the joys of mathematics as well as for those who may be uncomfortable with mathematics. Search Feature Column Feature Column at a glance 
Comments: Email Webmaster 
© Copyright
, American Mathematical Society


