Skip to content

datetime

Date and time operations with native implementation.

arc
use datetime

Functions

FunctionSignatureDescription
now() -> NumberCurrent Unix timestamp (milliseconds)
today() -> MapCurrent date as {year, month, day, hour, minute, second, ms}
parse(str) -> TimestampParse date string
format(ts, fmt) -> StringFormat timestamp
add_days(ts, days) -> TimestampAdd days to timestamp
add_hours(ts, hours) -> TimestampAdd hours to timestamp
add_minutes(ts, minutes) -> TimestampAdd minutes to timestamp
diff_days(a, b) -> NumberDays between two timestamps
diff_hours(a, b) -> NumberHours between two timestamps
diff_minutes(a, b) -> NumberMinutes between two timestamps
day_of_week(ts) -> StringDay of week name
is_before(a, b) -> BoolCheck if timestamp a is before b
is_after(a, b) -> BoolCheck if timestamp a is after b
to_iso(ts) -> StringConvert timestamp to ISO 8601 string
from_iso(str) -> TimestampParse ISO 8601 string to timestamp

A programming language designed by AI agents, for AI agents.