Cited by 0Historical Geography and Cartography

Algorithm for Julian dates

Open access
Branham, Richard L.·1995·ACM SIGNUM Newsletter

Abstract

C functions are given that allow one to calculate a Julian day number for a day, month, and year on the Julian calendar, take a Julian day number and convert it to a day, month, and year on the Julian calendar, and find the day of the week that corresponds to a day, month, and year on the Julian calendar.

AI snapshot

Written from the paper’s full text.

TL;DR

This short technical note supplies three C functions for working with dates on the Julian calendar: converting a year, month, and day into a Julian day number, converting a Julian day number back into a calendar date, and determining the weekday for a Julian-calendar date. The author motivates the routines by pointing out that published date algorithms generally target the Gregorian calendar and that at least one widely used library routine returns incorrect Julian-calendar results.

Key findings

The paper reports that IMSL's NDAYS routine gives 560869 days between Caesar's assassination (15 March 44 B.C.) and Columbus's landfall (12 October 1492), while the correct interval is 560870 days; the corresponding Julian day numbers are 1705426 and 2266296. It also reports that IDYWK correctly identifies Columbus's arrival as a Friday and the Ottoman capture of Constantinople (29 May 1453) as a Tuesday, but wrongly gives Thursday for Caesar's assassination, which was a Wednesday (the Julian day number modulo 7 yields 2). Worked examples from the new routines: Charlemagne's coronation on Christmas Day 800 falls on a Friday, the Battle of Hastings on 14 October 1066 falls on a Saturday, and 97084 days — 265.802 Julian years — separate the two events. The note contrasts the calendars' leap rules: every year divisible by 4 is a Julian leap year, whereas Gregorian century years are leap only if divisible by 400, so 1600, 1700, 1800, and 1900 were all Julian leap years but only 1600 (and 2000) are Gregorian leap years; the Julian year of 365.25 days errs by about 11 minutes annually against the true 365.2422-day year, versus 26 seconds for the Gregorian 365.2425-day approximation.

Methods

The contribution is algorithmic: three C functions, `julian` (year/month/day to Julian day number), `julian_ymd` (Julian day number to year/month/day, with results passed back by reference), and `day_of_week` (year/month/day directly to a weekday string). Correct use requires B.C. dates in astronomical style (subtract 1 from the year, so 44 B.C. becomes -43) and adjustment for the astronomical day, which the author treats as the civil day minus 0.5 days; `day_of_week` adds 4732 to the year, described as the smallest multiple of 28 that maps a B.C. year starting at 4713 B.C. to a positive year with matching weekdays. Correctness is illustrated through the historical examples above rather than through a formal proof or test suite.

Limitations

The paper states that `day_of_week` does not work for negative years, which is why the 4732-year offset is applied, and that `julian_ymd` depends on the library function `fabs`, so `math.h` must be included or an absolute-value macro substituted. It also notes that Julian day numbers follow the astronomical rather than civil day, and that before 1925 the astronomical day began at noon, so callers must apply the half-day correction themselves. Evident from the text but not framed as a limitation by the author: the routines are validated only against a handful of historical dates, no comparison is made against other implementations beyond the IMSL examples, and the printed code contains apparent transcription errors (for example, malformed conditionals and a truncated default branch in `day_of_week`).

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.1145/219340.219343

Cites

Statistics

Nothing to recompute.

Claims the paper makes

  • Findingown data

    Some published algorithms for manipulating dates on the Julian calendar are incorrect.

    “Algortihms for manipulating dates on the Julian calendar seem not to have been widely disseminated; some of them, moreover, are incorrect.”
    Quote in the paperSubstantial claim
  • Findingown data

    The IMSL routine IDYWK incorrectly calculates that Caesar was assassinated on Thursday.

    “Likewise, the routine IDYWK calculates correctly that America was discovered on a Friday, that Constantinople, captured by the Ottoman Turks on 29 May 1453, was taken on a Tuesday, but incorrectly that Caesar was assassinated on Thursday;”
    Quote in the paperSubstantial claim
    • Rests on an assumption: Julius Caesar was assassinated on 15 March 44 B.C.
  • Findingnone given

    The IMSL routine IDYWK correctly calculates that Constantinople, captured by the Ottoman Turks on 29 May 1453, was taken on a Tuesday.

    “Likewise, the routine IDYWK calculates correctly that America was discovered on a Friday, that Constantinople, captured by the Ottoman Turks on 29 May 1453, was taken on a Tuesday, but incorrectly that Caesar was assassinated on Thursday;”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: Constantinople was captured by the Ottoman Turks on 29 May 1453.
  • Findingreasoning

    Entering day=15.5, month=3, and year=-43 into the routine returns 1705426.0.

    “Enter da~lS.5, month=3, and year= -43.The routine returns 1705426.0 because the astronomical day of 15.0 coincides with the beginning of that JD.”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: Julius Caesar was assassinated on 15 March 44 B.C.
  • Findingreasoning

    Julius Caesar was assassinated on Wednesday.

    “Given the JD of Caesar's assassination, the result modulo 7 is 2, a Wednesday.”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: Julius Caesar was assassinated on 15 March 44 B.C.
  • Classified as probably not a substantial claim. 9
  • May combine two claims. 2
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingnone given

    The Battle of Hastings was fought on a Saturday.

    “What about the Battle of Hastings, fought on 14 October 1066?It was a Saturday.”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: The Battle of Hastings was fought on 14 October 1066.
  • May combine two claims.

    Findingreasoning

    IMSL's routine NDAYS calculates that 560869 days elapsed between the assassination of Julius Caesar (15 March 44 B.C.) and Columbus's discovery of America (12 October 1492), whereas the correct value is 560870 days.

    “IMSL's routine NDAYS, for example, calculates that 560869 days elapsed between the assassination of Julius Caesar (15 March 44 B.C.) and Colombus's discovery of America (12 October 1492), whereas the correct value is 560870.”
    Quote in the paperSubstantial claim
    • Rests on an assumption: Julius Caesar was assassinated on 15 March 44 B.C.
    • Rests on an assumption: Columbus discovered America on 12 October 1492.
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingnone given

    The Julian day number of the discovery of America is 2266296.

    “The Julian day number, usually written JD, of Caesar's assassination is 1705426, that of the discovery of America 2266296.”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: Columbus discovered America on 12 October 1492.
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingnone given

    Christmas Day, 800 was a Friday.

    “What day was that?Friday.”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: Charlemagne was crowned Emperor on Christmas Day, 800.
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingnone given

    The IMSL routine IDYWK correctly calculates that America was discovered on a Friday.

    “Likewise, the routine IDYWK calculates correctly that America was discovered on a Friday, that Constantinople, captured by the Ottoman Turks on 29 May 1453, was taken on a Tuesday, but incorrectly that Caesar was assassinated on Thursday;”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: Columbus discovered America on 12 October 1492.
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingreasoning

    The Julian day number of Caesar's assassination is 1705426.

    “The Julian day number, usually written JD, of Caesar's assassination is 1705426, that of the discovery of America 2266296.”
    Quote in the paperNot a substantial claim
    • Rests on an assumption: Julius Caesar was assassinated on 15 March 44 B.C.
  • Probably not a substantial claim: may not pass S3 (load-bearing). May combine two claims.

    Findingreasoning

    Given the Julian day number of Caesar's assassination, the result modulo 7 is 2, corresponding to a Wednesday.

    “Given the JD of Caesar's assassination, the result modulo 7 is 2, a Wednesday.”
    Quote in the paperNot a substantial claim
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Findingnone given

    Calling julian_ymd with JD 2266296 returns year=1492, month=10, and day=12.5.

    “If we call the function with JD 2266296, it returns year=1492, month=lO, and day=12.5.”
    Quote in the paperNot a substantial claim
  • Classified as probably not a substantial claim.

    Premisereasoning

    4732 is the smallest multiple of 28 that converts a B.C. year starting with 4713 B.C. (-4712) to a positive year with the same days of the week.

    “4732 is the smallest multiple of 28 that converts a B.C. year staring with 4713 B.C. (-4712) to a positive year with the same days of the week.”
    Quote in the paperSubstantial claim
    • Rests on an assumption: The days of the week on the Julian calendar repeat with a period of 28 years.
  • Probably not a substantial claim: may not pass S3 (load-bearing).

    Interpretationnone given

    97084 days is 265.802 years of the Julian calendar.

    “How much time elapsed between the two events?97084 days, or 265.802 years of the Julian calendar.”
    Quote in the paperNot a substantial claim
10 of 10
  • The paper relies on this without support.

    Algorithms for manipulating dates on the Julian calendar are not widely disseminated.

    “Algortihms for manipulating dates on the Julian calendar seem not to have been widely disseminated; some of them, moreover, are incorrect.”
  • The paper relies on this without support.

    Published algorithms for manipulating calendar dates are generally based on the Gregorian calendar, not the Julian calendar.

    “These algorithms are generally based on the Gregorian calendar, not the Julian calendar.”
  • The paper relies on this without support.

    Julius Caesar was assassinated on 15 March 44 B.C.

    “the assassination of Julius Caesar (15 March 44 B.C.)”
  • The paper relies on this without support.

    Columbus discovered America on 12 October 1492.

    “Colombus's discovery of America (12 October 1492)”
  • The paper relies on this without support.

    Constantinople was captured by the Ottoman Turks on 29 May 1453.

    “Constantinople, captured by the Ottoman Turks on 29 May 1453”
  • The paper relies on this without support.

    Charlemagne was crowned Emperor on Christmas Day, 800.

    “Charlemagne was crowned Emperor on Christmas Day, 800.”
  • The paper relies on this without support.

    The Battle of Hastings was fought on 14 October 1066.

    “the Battle of Hastings, fought on 14 October 1066”
  • The paper relies on this without support.

    The days of the week on the Julian calendar repeat with a period of 28 years.

    “the days of the week on the Julian calendar repeat with a period of 28 years.”
8 of 8

Authors
Branham, R. L.
Corresponding author
Branham, Richard L.
Venue
ACM SIGNUM Newsletter
Published
1995-10
Volume
30
Issue
4
Pages
14-18
ISSN
0163-5778 (ISSN-L)
OpenAlex
W2070326533
Cited by
0
References
0
FWCI
0.00
Type
journal article
Language
en
Open access
Locations
ACM SIGNUM Newsletter (publishedVersion)
Topics
Social Sciences › Geography, Planning and Development › Historical Geography and Cartography
Keywords
Julian calendar, date conversion, day of the week calculation, c-function

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Claims read by deepseek-v4.1-flash under definition version 3 (extract-v3) on 2026-10-11.

Classified by jev-1.13-20260917 (gold-guideline-v0.2) on 2026-10-11.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review