Handbook
Glossary
julian-day-number>date ( $n -- year month day )
Calendar
ยป
Calendar facts
Prev:
julian-day-number ( $year $month $day -- n )
Vocabulary
calendar
Inputs
$n
an
integer
Outputs
year
an
integer
month
an
integer
day
an
integer
Word description
Converts from a Julian day number back to a year, month, and day.
See also
julian-day-number
Definition
USING:
math
;
IN:
calendar
::
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
+
;