julian-day-number ( $year $month $day -- n )
Calendar ยป Calendar facts

Prev:week-number ( timestamp -- [1,53] )
Next:julian-day-number>date ( $n -- year month day )


Vocabulary
calendar

Inputs
$yearan integer
$monthan integer
$dayan integer


Outputs
nan integer


Word description
Calculates the Julian day number from a year, month, and day. The difference between two Julian day numbers is the number of days that have elapsed between the two corresponding dates.

Warning
Not valid before year -4800 BCE.


See also
julian-day-number>date

Definition


:: julian-day-number ( $year $month $day -- n )
14 $month - 12 /i :> $a $year 4800 + $a -
:> $y $month 12 $a * + 3 - :> $m $day 153 $m * 2 + 5 /i +
365 $y * + $y 4 /i + $y 100 /i - $y 400 /i + 32045 - ;