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

Prev:julian-day-number ( $year $month $day -- n )


Vocabulary
calendar

Inputs
$nan integer


Outputs
yearan integer
monthan integer
dayan integer


Word description
Converts from a Julian day number back to a year, month, and day.

See also
julian-day-number

Definition


:: julian-day-number>date ( $n -- year month day )
$n 32044 + :> $a 4 $a * 3 + 146097 /i :> $b $a 146097 $b *
4 /i - :> $c 4 $c * 3 + 1461 /i :> $d $c 1461 $d * 4 /i -
:> $e 5 $e * 2 + 153 /i :> $m 100 $b * $d + 4800 - $m 10 /i
+ $m 3 + 12 $m 10 /i * - $e 153 $m * 2 + 5 /i - 1 + ;