Handbook
Glossary
Calendar
The
calendar
vocabulary defines two data types and a set of operations on them:
timestamp
duration
Durations represent spans of time:
Using durations
Arithmetic on timestamps and durations:
Timestamp arithmetic
Getting the current timestamp:
now
( -- timestamp )
now-gmt
( -- timestamp )
now-utc
( -- timestamp )
Time zones:
>local-time
( timestamp -- timestamp' )
>gmt
( timestamp -- timestamp' )
>utc
( timestamp -- timestamp' )
convert-timezone
( timestamp duration -- timestamp )
Timestamps relative to each other:
Relative timestamps
Operations on units of time:
Year operations
Month names in English
Day names in English
Both
timestamp
s and
duration
s implement the
Linear order protocol
.
Solar position calculations:
sunrise
( timestamp latitude longitude -- new-timestamp )
sunset
( timestamp latitude longitude -- new-timestamp )
solar-noon
( timestamp longitude -- new-timestamp )
Metadata about the calendar:
Calendar facts