Calendar


The calendar vocabulary defines two data types and a set of operations on them:
Image
timestamp

Image
duration


Durations represent spans of time:
Image Using durations

Arithmetic on timestamps and durations:
Image Timestamp arithmetic

Getting the current timestamp:
Image
now ( -- timestamp )

Image
now-gmt ( -- timestamp )

Image
now-utc ( -- timestamp )


Time zones:
Image
>local-time ( timestamp -- timestamp' )

Image
>gmt ( timestamp -- timestamp' )

Image
>utc ( timestamp -- timestamp' )

Image
convert-timezone ( timestamp duration -- timestamp )


Timestamps relative to each other:
Image Relative timestamps

Operations on units of time:
Image Year operations
Image Month names in English
Image Day names in English

Both timestamps and durations implement the Linear order protocol.

Solar position calculations:
Image
sunrise ( timestamp latitude longitude -- new-timestamp )

Image
sunset ( timestamp latitude longitude -- new-timestamp )

Image
solar-noon ( timestamp longitude -- new-timestamp )


Metadata about the calendar:
Image Calendar facts