(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 32103, 774]*) (*NotebookOutlinePosition[ 32768, 798]*) (* CellTagsIndexPosition[ 32724, 794]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["\<\ MathSource Reviews \ \>", "Title"], Cell["Calendars, Time, and Dates in Mathematica\t", "Subtitle"], Cell["Edited by Matthew M. Thomas", "Subsubtitle"], Cell[TextData[{ "This MathSource review begins the fourth year of these reviews in this \ journal. As such, it might be appropriate to update concepts examined in past \ reviews. In that vein, note this: Recent Mathematica literature offers \ treatments of weighted voting systems [Tannenbaum 1997] examined here in \ issue 4(3), and of Spirograph(TM) output generation [Lee 1996] examined here \ in issue 3(1). But perhaps it would be more timely, on the third anniversary \ of these reviews, to explore that which alerts one to an anniversary's \ occurrence\[Dash]the calendar. This review examines the calendar, time, and \ date functions, notebooks, and packages available through ", StyleBox["MathSource", FontSlant->"Italic"], ". \n" }], "Text"], Cell[CellGroupData[{ Cell["Background", "Section"], Cell["\<\ The year: 1977 A.D. The scene: An episode of the American \ Broadcasting Company's situation comedy \"Barney Miller.\" Detective Stanley \ Wojehowicz [proper spelling vigorously debated in rec.arts.tv Usenet \ newsgroup posts] sits at his typewriter, pecking in information he receives \ from a middle-aged woman who may or may not have full use of her mental \ faculties. (Same may or may not be said of Detective Wojehowicz.)\t \"Age?\"\t\"Sixty-one.\"\tRight forefinger presses \"6\" key; left does same \ to \"1\" key.\t \"I was forty-five in '61.\"\tFlustered, the detective whites out \"61\" from \ the form. Having no access to abacus, computer, or Mathematica 3.0, he \ resorts to his fingers to calculate the age (in 1977) of a woman aged 45 \ years in 1961. The result and a realization of wasted effort simultaneously \ arrive: \t\"That makes you 61!\"\tIn this regard, the good detective would have \ benefitted from items MathSource offers. Those items will be examined in due \ course; let us first make a cursory examination of well-known calendars. \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Julian calendar", "Section"], Cell[TextData[ "Where to begin such an examination? Let us arbitrarily choose the 304-day, \ 10-month calendar of Romulus, wolf-suckled mythical founder of Rome. Numa \ Pompilius, Rome's second king, added fifty days to it, to coordinate this \ lunar calendar with the solar year. The resulting twelve-month calendar was \ the best approximation to a solar-seasonal year into which a whole number of \ lunar synodic months would fit. By 150 B.C., another day was added to this \ calendar, creating the 355-day year [Aveni, 1995]. But this modified calendar \ relied heavily upon intercalation\[Dash]the shoehorning of additional days \ into the calendar year\[Dash]to keep the months in step with the lunal phases \ and the year in sync with the seasons. Fixed rules for intercalation were not \ in place, and intercalation was performed inconsistently. The result: A \ vernal equinox on the Ides of May in 50 B.C. [Ronan 1995].\n\n\tWith \ intercalation more art than science, and with winter ending but a fortnight \ before June, action had to be taken. And so it was that in 46 B.C. (year 709 \ of Rome), Alexandrian astronomer Sosigenes proposed (and Julius Causar \ accepted) a fix and an abandonment of the Roman calendar. Accordingly, 46 \ B.C. suffered Two intercalations\[LongDash]a standard 23-day insertion after \ 23 February 46 B.C., and an unusual 67-day insertion between November and \ December to align the calendar with the equinoxes. Thus, 46 B.C., the months \ (365 days) was introduced. This new calendar, unlike its Roman predecessor \ but similar to the Egyptian calendar, was a solar-seasonal calendar. To make \ its average year 365.25 days, a 366th day was appended to February every four \ years. We know the resulting calendar as the Julian calendar.\t\n\t\n\tJulius \ Caesar was assassinated in 44 B.C. Perhaps in anticipation of modern \ recording artist Jimmy Buffett's \"Living Life in Three-Quarters' Time,\" the \ calendar-keepers began inserting the leap day every three years instead of \ every four. In 9 B.C., Caesar Augustus restored order by suspending leap \ years for sixteen years. It was not until 8 A.D. that the Julian calendar \ began to function with regularity [Bickerman, 1980]. Once on track, this \ calendar was in force for 1 1/2 millenia.\n"], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Gregorian calendar", "Section"], Cell[TextData[{ "In 730 A.D., Anglo-Saxon monk St. Bede the Venerable of Jarrow proclaimed \ the 365.25-day Julian year 11 minutes 14 seconds longer than the solar year \ [Famighetti, 1995, p. 309]. That's an error of only one day every 128 years, \ but just as the vernal equinox once encroached upon June, so it was that \ Easter Sunday began falling later and later in the spring season. The Easter \ warming caught the Vatican's attention, and in December 1545 A.D., the \ Council of Trent authorized Pope Paul III to take corrective action. \ Nonetheless, it wasn't until the efforts of Jesuit astronomer Christopher \ Clavius and Vatican librarian Luigi Lilio (Aloysius Lilius in some parts) \ that acceptable corrective action was available. This action was taken in \ 1582 by Pope Gregory XIII, who 1) added ten days to the Julian \ calendar\[Dash]the 15 October 1582 A.D. sunrise followed the 4 October \ sunset, 2) set the solar year at 365.2422 days, 3) decreed that only those \ century-closing years exactly divisible by 400 would be leap years (1600, \ 2000, 2400, ... but not 1700, 1800, 1900, ...), and 4) set Easter on the \ Sunday following the (Paschal) Full Moon occurring on/after the vernal \ equinox [Ronan 1995]. So came to be the Gregorian calendar, whose 365.2425 \ days per year make it accurate to one day every 3333 years 4 months. \t\n\n\t\ The Julian and Gregorian calendars coincided in 300 A.D.: before then, the \ former led the latter by three days every 400 years (29 December 102 B.C. \ Gregorian is 1 January 101 B.C. Julian); since then, the former lags the \ latter by the same period [Bickerman 1980]. Most Catholic countries adopted \ the Gregorian calendar in the late 16th century. Denmark and the Dutch and \ German Protestant states adopted it in the late 17th century. Britain and her \ colonies did so in 1752; Sweden, in 1753; Japan, 1873; Egypt, 1875; Albania, \ Bulgaria, China, Estonia, Latvia, Lithuania, Romania, and Turkey, 1912-1917; \ the Soviet Union, 1918; Greece, 1923 [Ronan 1995]. Switzerland began adoption \ proceedings in 1583 and completed them in 1812\[Dash]a duration consistent \ with its haste in accepting women's suffrage, no doubt. Alaska went Gregorian \ 130 years ago, upon its transfer from Russia to the United States. Of course, \ the longer a country waited before adopting the Gregorian calendar, the more \ days it had to add upon conversion. In Brittania, for example, 2 September \ 1752 was followed by 14 September: George Washington saw his 21st birthday \ move from 11 February to 22 February.\n\t\n\tSubsequent Gregorian calendar \ reforms included removal of leap-year status from century-closing years 4000, \ 8000, and 12,000 A.D. At an Eastern Orthodox congress in Constantinople in \ 1923, the century-closing rule was revised: Century-closing years would now \ be leap years only if, upon division by 900, a remainder of 200 or 600 \ resulted. This revision retains 2000 and 2400 as the only century-closing \ leap years for the next 800 years, and creates a 365.2422222", Cell[BoxData[ \(TraditionalForm\`2\&_\)]], "-day year ... accurate to one day in 45,045 years [Aveni 1995]. A scheme \ calling for eleven century-closing leap years every fifty millenia would meet \ the Gregorian-standard 365.2422-day solar year to all four decimal places, \ but that scheme comes with a whiff of overkill: Other bodies in the solar \ system induce gravitational disturbances on the earth, thus subtly altering \ the length of its solar year.\n\t\t\n\t(A closing note on the Gregorian \ calendar, to unnerve and prod Mathematica advocates ailing from \ triskaidekaphobia: In this, the thirteenth MathSource review, be it noted \ that in the calendar of the thirteenth Pope Gregory, it was found by a \ 13-year old [Baxter, 1969] that the thirteenth day of a Gregorian month was \ most likely to fall on\[Dash]of all days of the week\[Dash]a Friday. Be it \ also noted that precocious Master Baxter made or published said discovery \ while matriculating at Eton, as either a predecessor or a contemporary of \ precocious Master Stephen Wolfram.)\n" }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Islamic, Jewish, and other calendars", "Section"], Cell[TextData[ "The Islamic calendar traditionally comprises twelve months, each dating from \ one crescent moon to the next. It is a lunar calendar, and since sightings of \ the moon vary with latitude and longitude, so does this calendar. As with the \ Jewish calendar, the Islamic calendar days run from sunset to sunrise; as \ with the Gregorian calendar, however, there are seven days to a week. The \ Islamic Era begins on the first day of the Arabic year in which the Hegira of \ Muhammed took place. That year, 1 A.H., corresponds to 16 July 622 A.D., for \ that was the day on which the Hegira of Muhammed (the emigration from Mecca \ to Medina) began. The Islamic calendar has approximately 354 days in its \ year, so translating its dates into solar calendar dates is not \ straightforward. One Gregorian-to-Islamic translation formula calls for \ subtracting 622 from the Gregorian date, then adding the \"total of the \ Gregorian date minus 622 divided by 32 ... [but] this formula is somewhat \ inaccurate, and it is thus better to consult a conversion table\" [Schubel \ 1995]. We are now in year 1417 A.H. of the Islamic calendar.\t\n\n\tThe \ Jewish calendar is lunisolar, with the moon governing the months and the sun \ the year. Intercalation is a necessary staple of this calendar, lest the same \ fate befall Jewish festivals that befell Easter in Gregory XIII's day and the \ vernal equinox during Julius Caesar's. In this case, intercalation takes the \ guise of a month\[Dash]Adar II or Adar Sheni\[Dash]added in years 3, 6, 8, \ 11, 14, 17, and 19 of the 19-year lunar cycle. Rosh Ha-Shanah (New Year's \ Day) is fixed in accordance with four decidedly non-trivial criteria \ involving Yom Kippur, Hoshana Rabba, specific days of the week, and other \ factors [Wiesenberg, 1971]. We are now in year 5757 A.M. of the Jewish \ calendar. Just as a conversion table benefits Gregorian-to-Islamic date \ translation, so does a Gregorian-Jewish combination calendar offer equivalent \ benefits. Volume 1 of Encyclopaedia Judaica [1972] presents such a calendar, \ covering Gregorian years 1920 - 2020 A.D (Jewish years 5680 - 5780 A.M.).\t\n\ \t\n\tThe International Fixed Calendar and the World Calendar have been \ presented as new calendars for the modern age. The former comprises thirteen \ months of 28 days each (surely to the delight of triskaidekaphobics \ everywhere), with an additional day at the end of the year. The latter \ comprises four quarters of 91 days each. Each has an intercalation scheme for \ leap day insertion [Ronan, 1995]. There are said to be advantages to each \ strategy. One might surmise, however, that a calendar change would be as \ welcomed by the masses as, say, a 67-day intercalation between November and \ December by Santa-fixated children on Thanksgiving day.\n"], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Year 2000 and beyond", "Section"], Cell[TextData[ "No discussion of calendars would be complete without a mention of the \"year \ 2000 problem.\" Most business applications (payroll, accounts receivable, et \ al) are coded in primitive, workhorse languages such as COBOL and APL. The \ \"year 2000 problem\" is generally found within the working-storage sections \ of these COBOL programs, where templates for dates tend to use a MM/DD/YY \ format (following the U.S. convention of month/date/year). Note the allowance \ for only two\[Dash]not four\[Dash]year-related digits\[Dash]a convention \ intended to save memory by sparing the program those redundant \"19\" digits. \ The convention does save memory, but creates a side-effect that is \ potentially disastrous: Programs following this convention, given but two \ digits for denoting the year, may now treat the day after 31 December 1999 as \ 1 January 1900, wreaking pure havoc on all date-related calculations. The \ woman in the aforementioned \"Barney Miller\" episode, aged 45 years in 1961 \ A.D., would be 84 in 2000 A.D. Nonetheless, come the last year in the second \ millenium A.D. ...\n\n\twoman: \"I was born in '16.\"\n\t\n\tWojehowicz \ [bemused]: \"The computer says you're 16 years old!\" \t\n\t\n\tA web site \ devoted to this problem has URL www.year2000.com. At that site are a number \ of papers, by Peter de Jager and others, discussing the consequences of \ ignoring this problem. One of the papers, a 6 September 1993 Computerworld \ article by de Jager, estimates that Fortune 50 companies must spend $0.35 to \ $0.40 per line of code\[Dash]$50 million to $100 million total per company. A \ later paper, by David Loundy from the 14 November 1996 Chicago Daily Law \ Bulletin, places that cost at $1.02 to $8.52 per line of code\[Dash]$358 \ million to $3 billion total for organizations such as the Department of \ Defense. Code alteration and testing incur these costs, which do not lessen \ as 2000 draws near. To dramatize the problem, this web site features a clock \ that counts down to midnight, 1 January 2000 A.D.\n\t\n\tThe SPR company is \ one of many firms now hiring COBOL programmers to combat the year 2000 \ problem. Their web site, whose URL is www.sprinc.com/spr_home.htm, discusses \ this problem and also discusses Julian and Gregorian calendars (see \ www.sprinc.com/marktime.htm as of late January 1997). \"Does twelve minutes \ seem like a lot of time to you?\" begins the latter discussion, in reference \ to the discrepancy between the Julian calendar and the solar year. \"Imagine \ that for an entire year you were twelve minutes early for your appointments. \ This would be a good thing right? Aren't we told to be early for our \ appointments \[Dash] that it is courteous to be early and usually \ unacceptable to be late?\" Indeed. Harlan Ellison's \"'Repent, Harlequin!' \ Said the Ticktockman\" [Ellison 1987] describes a world in which every twelve \ minutes of tardiness would cost you twelve minutes of your life. In 2389 \ A.D., when this penalty would per the story take effect, might the tools of \ the Master Timekeeper (the \"Ticktockman\") have their origin in what is now \ known as MathSource?\n"], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["MathSource items", "Section"], Cell["\<\ When we comb through MathSource at URL www.wolfram.com/mathsource/, \ we find three items pertaining to calendars et al. The first is \"Time and \ Date routines\" by Thomas Cool of the Netherlands, found at \ pub/Applications/Other/0208-156 and dated August 1995. This item comprises \ three documents: a Readme file (2 kB), the Time.m package (7 kB), and the \ Time.ma notebook (28 kB). The second is \"TimeMath\" by Jack Calman of Johns \ Hopkins, found at pub/Applications/Other/0208-369 and dated October 1996. \ This item comprises the TimeMath.ma notebook (9 kB). The third is \"Calendar \ and Date Computations\" by Ilan Vardi, whose Computational Recreations in \ Mathematica was published by Addison-Wesley in 1991. This item is found at \ pub/Enhancements/Other/0200-776, and comprises Calendar.m (16 kB), \ Documentation.txt (5 kB), and SampleInput.txt (431 bytes). \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Time and Date routines", "Section"], Cell["\<\ \tThis item, submitted by Thomas Cool (cool@can.nl), is intended to \ supplement the standard Miscellaneous`Calendar` package by Ilan Vardi (about \ which more later). Material contained therein is intended to complement \ Decision Support and Genetic Programming packages, available at cost from \ Thomas Cool. He also requests that a $10 license be paid for using the Time.m \ package and the Time.ma notebook. This item works in conjunction with \ pub/Enhancements/System/0208-167, which contains items Readme.txt, \ Common_q.ma, Common.m, Context.m, Declare.m, List.m, Tool.m, Manager.m, and \ CoolPacs.m. Of these, only Context.m, Declare.m, Manager.m, and CoolPacs.m \ load (using the <", "Text"], Cell[CellGroupData[{ Cell["AnyToCalendarDate[{1,30,1997}]", "Input"], Cell[BoxData[ \({1997, \ 1, \ 30}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["AnyToStandardDate[{1,30,1997}]", "Input"], Cell[BoxData[ \({1997, \ 1, \ 30, \ 0, \ 0, \ 0}\)], "Output"] }, Open ]], Cell["\<\ The StringToDate[ ] function converts 6-digit YYMMDD string input \ into the standard Mathematica date format. Note how the option allows for one \ to override the default year 1950: \ \>", "Text"], Cell[CellGroupData[{ Cell["StringToDate[\"000101\"]", "Input"], Cell[BoxData[ \({2000, \ 1, \ 1, \ 0, \ 0, \ 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["StringToDate[\"000101\",First -> 1850]", "Input"], Cell[BoxData[ \({1900, \ 1, \ 1, \ 0, \ 0, \ 0}\)], "Output"] }, Open ]], Cell["\<\ A closely-related IntegerToDate[ ] function performs this \ conversion given an 8-digit YYYYMMDD string, or given a 6-digit YYYYMM \ string.\t \tOther functions in Time.m (aside from those taken directly from the \ Miscellaneous`Calendar` package itself) include DateToDays[ ] and DaysToDate[ \ ]. In the Gregorian, Islamic, or Julian calendar system, the former converts \ the date, in {year, month, day} format, into a count of days since date {1, \ 1, 1} in the given calendar (most likely through using the standard function \ DaysBetween[{1,1,1},{y,m,d}] + 1). The latter performs the reverse operation. \ Yet other functions have purposefully been altered, so as not to perform \ properly in the absence of a license. To with, CoordiDate[{1995,9,15}] is \ supposed to return 1995.7, according to the documentation in Time.ma. \ Clearly, 1995.7 is a fractional representation of 15 September 1995. But when \ we run this function with this argument, we get the following: \ \>", "Text"], Cell[CellGroupData[{ Cell["CoordiDate[{1995,9,15}]", "Input"], Cell[BoxData[ \(This\ is\ a\ mutilated\ routine\)], "Message"], Cell[BoxData[ \(2.22068\ 10^7\)], "Output"] }, Open ]], Cell["\<\ It does not take much in Mathematica to create a function \ equivalent to this one, especially given the Miscellaneous`Calendar` package \ from which to work. As such, the purpose for altering this function so as to \ render it inoperable is not clear. \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["TimeMath", "Section"], Cell["\<\ Of the three items, this notebook is the most simple. It comprises \ two functions, TimeAdd[ ] and TimeBetween[ ]. Both deal with time in the \ format {year, month, day, hour, min, sec}; where all the variables are \ integers (and year is not limited to two digits, fortunately). The first adds \ an increment of time to a start date; the second subtracts a stop time from a \ start time. The functions are not profusely documented, but descriptions, \ examples, and error messages in conjunction with both functions are \ available. \t \tHere is TimeAdd: \ \>", "Text"], Cell["\<\ TimeAdd[tstart_, dt_] := If[tstart[[2]] == 0 || tstart[[3]] == 0, Message[TimeAdd::MonthDayNumb], ToDate[FromDate[tstart] + FromDate[{1900, 1, 1, 0, 0, 0} + dt]]] \ \>", "Input"], Cell["\<\ Any year 2000 problem here? \ \>", "Text"], Cell[CellGroupData[{ Cell["TimeAdd[{1999,12,31,23,59,59},{0,0,0,0,0,2}] ", "Input"], Cell[BoxData[ \({2000, \ 1, \ 1, \ 0, \ 0, \ 1}\)], "Output"] }, Open ]], Cell["\<\ No, fortunately: Two seconds after 11:59:59 pm on 31 December 1999 \ is indeed 12:00:01am on 1 January 2000. Now, what about leap day recognition? \ Here is what happens when we add one day to noon 28 February in three \ different years:\ \>", "Text"], Cell[CellGroupData[{ Cell["TimeAdd[{2000,2,28,12,0,0},{0,0,1,0,0,0}] ", "Input"], Cell[BoxData[ \({2000, \ 2, \ 29, \ 12, \ 0, \ 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["TimeAdd[{1900,2,28,12,0,0},{0,0,1,0,0,0}] ", "Input"], Cell[BoxData[ \({1900, \ 3, \ 1, \ 12, \ 0, \ 0}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["TimeAdd[{2800,2,28,12,0,0},{0,0,1,0,0,0}] ", "Input"], Cell[BoxData[ \({2800, \ 2, \ 29, \ 12, \ 0, \ 0}\)], "Output"] }, Open ]], Cell["\<\ The year 2000 is indeed a leap year, while 1900 is indeed not one. \ The year 2800 is a leap year in the Gregorian scheme, but not in the 1923 \ Constantinople revision ... a revision not widely known and, probably, less \ widely accepted.\t \tHere is TimeBetween:\t \ \>", "Text"], Cell["\<\ TimeBetween[tstart_, tstop_] := \tIf[FromDate[tstop] > FromDate[tstart], ToDate[FromDate[tstop] - FromDate[tstart]] - \t\t\tToDate[0], \ Message[TimeBetween::StopTime]] \ \>", "Input"], Cell["\<\ Despite Peter de Jager's warnings, how much longer can I twiddle my \ thumbs before the year 2000 is upon me?\t \ \>", "Text"], Cell[CellGroupData[{ Cell["TimeBetween[Date[], {2000,1,1,0,0,0}]", "Input"], Cell[BoxData[ \({2, \ 10, \ 17, \ 16, \ 51, \ 56}\)], "Output"] }, Open ]], Cell["\<\ The output (two years, ten months, and change) is accurate as of \ this writing. In Ellison's short story, the Master Timekeeper begins \ penalizing tardiness at midnight 15 July 2389. Upon welcoming the year 2000, \ how much longer can I disregard timetables before I lose time off my life? \ \>", "Text"], Cell[CellGroupData[{ Cell["TimeBetween[{2000,1,1,0,0,0}, {2389,7,15,0,0,0}] ", "Input"], Cell[BoxData[ \({389, \ 6, \ 14, \ 0, \ 0, \ 0}\)], "Output"] }, Open ]], Cell["\<\ Three-hundred eighty-nine more years must pass between the year \ 2000 celebration and my submitting my time-card and cardioplate for \ processing. We should live so long. \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Calendar and Date Computations", "Section"], Cell["\<\ This item is the standard Miscellaneous'Calendar' package by Ilan \ Vardi. As is expected from the standard packages, the accompanying \ documentation is thorough: Each available function is explained, and \ background discussion on the workings of well-known calendars is included. \ References (including some that are also cited in the Bibliography below) are \ cited in the documentation, such that interested users can pursue them if \ they wish. The SampleInput.txt file contains sample inputs to the Calendar.m \ package.\t \tFunctions available through the Calendar.m package are DayOfWeek[ ], \ DaysBetween[ ], CalendarChange[ ], EasterSunday[ ], \ EasterSundayGreekOrthodox[ ], and JewishNewYear[ ]. The user is cautioned \ that the Julian calendar functions are valid starting only in 4 A.D., while \ the Jewish New Year computations work only for Gregorian years between 1900 \ and 2100, inclusive. As such, we cannot use these functions to verify that . \ We can, however, investigate other dates. \t \tAfter loading Calendar.m, we can use these functions to determine the date \ the Hegira began, to confirm that the current Islamic year is 1417 A.H., to \ verify the Julian-to-Gregorian conversion dates for the Vatican and for the \ British empire, and to calculate Easter Sunday and for 1997 A.D. \ \>", "Text"], Cell[CellGroupData[{ Cell["CalendarChange[{1,1,1},Islamic,Julian] ", "Input"], Cell[BoxData[ \({622, \ 7, \ 16}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["CalendarChange[Date[], Gregorian,Islamic] ", "Input"], Cell[BoxData[ \({1417, \ 9, \ 29}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["CalendarChange[{1582,10,5},Julian,Gregorian] ", "Input"], Cell[BoxData[ \({1582, \ 10, \ 15}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["CalendarChange[{1752,9,3},Julian,Gregorian] ", "Input"], Cell[BoxData[ \(\(\ {1752, \ 9, \ 14}\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["EasterSunday[1997]", "Input"], Cell[BoxData[ \({1997, \ 10, \ 2}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["JewishNewYear[1997]", "Input"], Cell[BoxData[ \({1997, \ 10, \ 2}\)], "Output"] }, Open ]], Cell["\<\ \tAll seems well. Now, let us examine the days of the week fora \ would-be leap day: \ \>", "Text"], Cell[CellGroupData[{ Cell["DayOfWeek[{2100,2,29}, Calendar -> Gregorian] ", "Input"], Cell[BoxData[ \(Monday\)], "Output"] }, Open ]], Cell["\<\ Wait a second. The year 2100 is not a leap year in the Gregorian \ calendar; 29 February 2100 does not exist: The Time.m package (above) even \ returns False for LeapQ[2100, Calendar -> Gregorian], as it should. So why no \ error message? And how serious is this error? To answer the latter question, \ let us use the function on 28 February and 1 March of 2100 A.D.\t \ \>", "Text"], Cell[CellGroupData[{ Cell["DayOfWeek[{2100,2,28}, Calendar -> Gregorian] ", "Input"], Cell[BoxData[ \(Sunday\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["DayOfWeek[{2100,3,1}, Calendar -> Gregorian]", "Input"], Cell[BoxData[ \(Monday\)], "Output"] }, Open ]], Cell["\<\ Well, at least its assignment of a day to the nonexistent 29 \ February 2100 did not disturb the count of days. To verify that lack of \ disturbance, let us check the days between 28 February and 1 March of 2100: \ \>", "Text"], Cell[CellGroupData[{ Cell["DaysBetween[{2100,2,28},{2100,3,1}] ", "Input"], Cell[BoxData[ \(1\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["DaysBetween[{2100,2,27},{2100,2,28}] ", "Input"], Cell[BoxData[ \(1\)], "Output"] }, Open ]], Cell["\<\ The nonexistent leap day does not seem to be counted. The original \ error is definitely an error, but at least its effects are contained. \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Summary", "Section"], Cell[TextData[ "It may well be that the packages Thomas Cool has available for licensing are \ useful and worth the licensing prices he asks. Most of his packages now \ available through MathSource require a license to run; as such, trying to \ examine them through MathSource may not reveal the true breadth of their \ capabilities. Nonetheless, those functions that are made available \ license-free should entice the user to license the entire package\[Dash]or at \ least a part thereof. In this case, the available functions fail to do so. \ They appear to offer list processing capabilities now widely available in \ Mathematica circles, as well as date processing capabilities independently \ available through the Miscellaneous`Calendar` package. In addition, the \ documentation should better explain how the available functions operate, in \ the presence of and in the absence of a license. Exploration is free for most \ MathSource items, but when fees are involved, caveat emptor is the rule.\n\t\n\ \tThe TimeMath item submitted by Jack Calman is by no means an elaborate \ notebook with extensive examples and illustrations. It is but a collection of \ a couple of functions that have their use in doing arithmetic with time. \ Still, it has a well-deserved home in MathSource, since it provides \ instructions, examples, and error messages for those functions. The notebook \ offers a template for those seeking to build more complicated functions \ involving time, as well as for those looking to submit simple but useful \ notebooks to MathSource.\n\t\n\tThe standard package for calendar operations \ by Ilan Vardi is as one would expect a standard Mathematica package to be: \ Thoroughly documented and useful. It is a model for developers to follow in \ that regard. And although its functions cover only a limited range of time, \ they do seem to perform their tasks properly. The noteworthy exception is the \ DayOfWeek[ ] function, which happily returns a day even when nonexistent \ dates comprise the function input. Fortunately, the magnitude of that error \ appears to be contained, as it does not appear to affect the \ days-between-dates function adversely. Good thing, too, for a standard \ package.\n"], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["REFERENCES", "Section"], Cell["\<\ Aveni, A. F., Empires of Time: Calendars, Clocks, and Cultures, New \ York: Kodansha International, 1995. Baxter, S. R., To Prove That the 13th Day of the Month Is More Likely to Be a \ Friday Than Any Other Day of the Week, The Mathematical Gazette, 53(384), \ 127-129, 1969. Bickerman, E. J., Chronology of the Ancient World, 2nd ed., Ithaca, NY: \ Cornell University Press, 1980. Ellison, H., \"Repent, Harlequin!\" Said the Ticktockman, (originally \ published in Galaxy Magazine, 1965) The Essential Ellison, Omaha, NE: \ NemoPress, 877-886, 1987. Famighetti, R., ed., World Almanac and Book of Facts 1996, Mahwah, NJ: Funk & \ Wagnalls Corp., 1995.\"Hundred-Year Jewish Calendar, 1920-2020,\" \ Encyclopaedia Judaica, Vol. 1, G. Wigoder, ed., Jerusalem: Keter Publishing \ House, Ltd., 109-159, 1972. Lee, X., \"Trochoids, Hypotrochoids and Epitrochoids,\" Mathematica in \ Education and Research, 5(2), 37-41, 1996. Ronan, C. A., \"The Western Calendar and Calendar Reforms,\" The New \ Encyclopaedia Brittanica, Vol. 15 (Macropaedia), 429-432, 1995. Schubel, V. J., \"Islamic Calendar,\" The Oxford Encyclopedia of the Modern \ Islamic World, Vol. 2, J. L. Esposito, ed., Oxford: Oxford University Press, \ 301, 1995. Tannenbaum, P., \"Power in Weighted Voting Systems,\" The Mathematica \ Journal, 7(1), 58-63, 1997. Wiesenberg, E. J., \"Calendar,\" Encyclopaedia Judaica, Vol. 5, G. Wigoder, \ ed., Jerusalem: Keter Publishing House, Ltd., 43-44, 1971.() \ \>", "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"NeXT 3.0", ScreenRectangle->{{0, 1053}, {0, 832}}, WindowToolbars->"EditBar", WindowSize->{520, 600}, WindowMargins->{{Automatic, 27}, {23, Automatic}} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1731, 51, 44, 3, 136, "Title"], Cell[1778, 56, 63, 0, 89, "Subtitle"], Cell[1844, 58, 50, 0, 51, "Subsubtitle"], Cell[1897, 60, 761, 13, 158, "Text"], Cell[CellGroupData[{ Cell[2683, 77, 29, 0, 52, "Section"], Cell[2715, 79, 1092, 21, 286, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[3844, 105, 34, 0, 52, "Section"], Cell[3881, 107, 2306, 30, 478, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6224, 142, 37, 0, 52, "Section"], Cell[6264, 144, 4155, 57, 799, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[10456, 206, 55, 0, 52, "Section"], Cell[10514, 208, 2836, 37, 558, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[13387, 250, 39, 0, 52, "Section"], Cell[13429, 252, 3196, 42, 670, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[16662, 299, 35, 0, 52, "Section"], Cell[16700, 301, 901, 14, 190, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[17638, 320, 41, 0, 52, "Section"], Cell[17682, 322, 1014, 15, 206, "Text"], Cell[CellGroupData[{ Cell[18721, 341, 47, 0, 24, "Input"], Cell[18771, 343, 51, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[18859, 349, 47, 0, 24, "Input"], Cell[18909, 351, 66, 1, 24, "Output"] }, Open ]], Cell[18990, 355, 207, 5, 78, "Text"], Cell[CellGroupData[{ Cell[19222, 364, 41, 0, 24, "Input"], Cell[19266, 366, 65, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[19368, 372, 55, 0, 24, "Input"], Cell[19426, 374, 65, 1, 24, "Output"] }, Open ]], Cell[19506, 378, 1002, 17, 238, "Text"], Cell[CellGroupData[{ Cell[20533, 399, 40, 0, 24, "Input"], Cell[20576, 401, 66, 1, 20, "Message"], Cell[20645, 404, 47, 1, 24, "Output"] }, Open ]], Cell[20707, 408, 278, 7, 94, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[21022, 420, 27, 0, 52, "Section"], Cell[21052, 422, 581, 12, 158, "Text"], Cell[21636, 436, 202, 7, 84, "Input"], Cell[21841, 445, 52, 3, 46, "Text"], Cell[CellGroupData[{ Cell[21918, 452, 62, 0, 24, "Input"], Cell[21983, 454, 65, 1, 24, "Output"] }, Open ]], Cell[22063, 458, 261, 5, 62, "Text"], Cell[CellGroupData[{ Cell[22349, 467, 59, 0, 24, "Input"], Cell[22411, 469, 67, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22515, 475, 59, 0, 24, "Input"], Cell[22577, 477, 66, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22680, 483, 59, 0, 24, "Input"], Cell[22742, 485, 67, 1, 24, "Output"] }, Open ]], Cell[22824, 489, 292, 8, 110, "Text"], Cell[23119, 499, 202, 6, 72, "Input"], Cell[23324, 507, 136, 4, 62, "Text"], Cell[CellGroupData[{ Cell[23485, 515, 54, 0, 24, "Input"], Cell[23542, 517, 67, 1, 24, "Output"] }, Open ]], Cell[23624, 521, 316, 6, 94, "Text"], Cell[CellGroupData[{ Cell[23965, 531, 66, 0, 24, "Input"], Cell[24034, 533, 65, 1, 24, "Output"] }, Open ]], Cell[24114, 537, 196, 5, 62, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[24347, 547, 49, 0, 52, "Section"], Cell[24399, 549, 1340, 23, 318, "Text"], Cell[CellGroupData[{ Cell[25764, 576, 56, 0, 24, "Input"], Cell[25823, 578, 50, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[25910, 584, 59, 0, 24, "Input"], Cell[25972, 586, 51, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26060, 592, 62, 0, 24, "Input"], Cell[26125, 594, 52, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26214, 600, 61, 0, 24, "Input"], Cell[26278, 602, 57, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26372, 608, 35, 0, 24, "Input"], Cell[26410, 610, 51, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26498, 616, 36, 0, 24, "Input"], Cell[26537, 618, 51, 1, 24, "Output"] }, Open ]], Cell[26603, 622, 109, 4, 46, "Text"], Cell[CellGroupData[{ Cell[26737, 630, 63, 0, 24, "Input"], Cell[26803, 632, 40, 1, 24, "Output"] }, Open ]], Cell[26858, 636, 393, 7, 94, "Text"], Cell[CellGroupData[{ Cell[27276, 647, 63, 0, 24, "Input"], Cell[27342, 649, 40, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27419, 655, 61, 0, 24, "Input"], Cell[27483, 657, 40, 1, 24, "Output"] }, Open ]], Cell[27538, 661, 237, 5, 78, "Text"], Cell[CellGroupData[{ Cell[27800, 670, 53, 0, 24, "Input"], Cell[27856, 672, 35, 1, 24, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27928, 678, 54, 0, 24, "Input"], Cell[27985, 680, 35, 1, 24, "Output"] }, Open ]], Cell[28035, 684, 163, 4, 62, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[28235, 693, 26, 0, 52, "Section"], Cell[28264, 695, 2242, 30, 462, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[30543, 730, 29, 0, 52, "Section"], Cell[30575, 732, 1500, 38, 542, "Text"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)