Blinking snake



jday - Calculate Julian Period day


jday [-h?MvbjwTcgpItzV] <date(s)> ...


Jday calculates a Julian Period Date from a calendar date (3/3/1990) or, if no date is supplied on the command line, from the system date. Jday will also calculate the calendar date from a supplied Julian Period Date. For further details, see “HISTORY” below.


-h or -?
Print a help message and die; -h goes to stderr, -? goes to stdout.
Print this manual page & die.
Verbose mode; -vv for very verbose. The requested information is supplied, plus (for -v) the calendar dates in both styles (Gregorian and Julian) or (for -vv) a complete dump of everything known about both styles of dates. The program may assume you have a vt100-compatible terminal, unless it has been compiled without the -DTERMDEPENDENT flag.
For calendar dates before 1 CE, use the “standard” notational style, i. e., the year before 1 CE is displayed as 1 BC. By default, jday displays in “astronomical” format, where the year before 1 CE is the year 0.
Input dates (3/3/1990) are assumed to be in the Julian Style calendar (which, at the time of this writing, is 13 days behind the Gregorian Style).
Show the day of the week for the calculated Julian Period Date.
Show the time of day in hours, minutes and seconds.
Julian Period Date in, Julian Calendar date out.
Julian Period Date in, Gregorian Calendar date out.
Obtain input dates/Julian Period dates from <file> in addition to or instead of from the command line. The filename given may refer to a file, or it may be stdin, stderr, stdout or /dev/tty.
Prompt if the input file given for the -I option is stdin or /dev/tty.
Indicates that jday should use gmtime() instead of localtime() to obtain the current system time; equivalent to setting the environment variable TZ to “UTC” or “GMT”.
Print version date and die.


The syntax for a calendar date is restricted to
where ‘mm’ is the month (range 1-12), ‘dd’ is the day of the month (range 1-31) and ‘[-]yyyy[b]’ is the year. Year may be signed [-], in which case astronomical format is assumed, or it may be followed by the optional letter ‘b’, signifying that the input year is “standard” BC style and that the same output format is desired.


When Julian Period Dates are specified on the command line or read from a file or stdin, jday assumes that they refer to period 0 (the current period). Other periods may be requested by using the format
where the digits before the decimal point give the Julian Period Day, the digits after the decimal point are the decimal time of day (Julian Period Days begin at noon), and the digit(s) after the # sign refer to the period desired. For reference, the following table shows the current period, the prior one, and the next period, in both style calendars.

Julian Style
Period From To
0 1/1/-4712 12/31/3267
-1 1/1/-12692 12/31/-4713
1 1/1/3268 12/31/11247
Gregorian Style
Period From To
0 11/24/-4713 1/22/3268
-1 9/26/-12693 11/23/-4713
1 1/23/3268 3/22/11248


% jday
% jday -wT
07:07:45  Sunday 2447954.80
% jday -v
Sunday Julian Day # 2447954.80
[  4 Mar 1990 ] {#063} Gregorian Style (365 days) is
[ 19 Feb 1990 ] {#050} Julian Style (365 days). [Deviation 13].
% jday -g 2447954.80#1
3 May 9970
% jday -c 2447954.80#1
19 Feb 9970


The Julian Period system (or Julian Day system, as it is usually referred to) was designed by Joseph Justus Scaliger [1540-1609], a prolific scholar and one of the first chronologists. He wrote primarily in Latin and Greek, and published on the comparative chronology of Western and Oriental cultures.

In order to make meaningful comparisons, he required a uniform method of dating events, and therefore implemented his Julian Period system. He based the system on the calendar in use during his lifetime, the Julian Style calendar, which had the advantage of extreme regularity. Scaliger combined several time-cycles with the Julian Style calendar to implement his system; one of these cycles was known as the “Cycle of Indiction,” a 15-year period having to do with taxation in the Roman Empire. Another was the “Solar Cycle,” which is the 28-year frequency of repetition of identical calendars in the Julian Style (1609 has the same calendar as 1637, for example); and the final cycle was the “Golden Number,” a 19-year cycle that originally enabled lunar calculations in the Julian Style Calendar (for the date of Easter). All three of these cycles, when projected backward in time, coincided in the year 4713 BC (-4712). Scaliger set the beginning day of his system to January first, 4713 BC, at noon, and numbered the days from that point. He named the system for his father, Julius Caesar Scaliger.

The Julian Period system is periodic in nature; it is 7980 years long (the product of 28 [the Solar cycle] times 19 [the Golden number] times 15 [Cycle of the Indiction]), and contains 2,914,695 days. Years are numbered from 1 through 7980 (1990 is JY 6703), but hardly anyone uses Julian Years (except for The Old Farmer’s Almanac). Once the date is known in the Julian Style calendar, it is a simple matter to convert the year into the Julian Year. See grj, a program to convert Gregorian Style dates into Julian Style dates.

Some organizations (notably the U. S. Naval Observatory) use a “Modified Julian Date,” which is the normal Julian Date referenced to Julian Day 2400000.5, or (Gregorian) Wednesday, 17 November 1858, midnight (Julian 5 November, 1858; also a Wednesday, also midnight). Note that the MJD changes at midnight, UTC, instead of noon. The Unix® epoch, in the MJD notation, is 40587.0; in standard JD format, it is 2440587.5.


The ? in the -? option must be escaped (preceded with a \) on the command line to prevent metacharacter expansion by some shells.

No attempt is made to automatically convert the local system time into UTC when the date and time are obtained from the system; jday simply treats the time retrieved from the system as UTC time. This is almost never a correct assumption. If this matters, either set your environment variable TZ to UTC (or GMT) or use the -z option, and the JD reported will be correct for the current UTC. Other calculations are derived from the user’s data, so it is the user’s responsibility to take timezone information into account.


jug(I), grj(I), devn(I), utc(I), usnaval(I), itimelib(I)




Ivan Van Laningham. If you would like the C source, email me.

Previous Page
Table of Contents
Next Page

Main web site:

Valid HTML 4.01 Transitional