time Module

Functions for working with time-of-day values, including extraction, construction, arithmetic, and formatting.

Extraction

Construction

Manipulation

Formatting

Function Reference

FunctionDescription
time::hourExtract the hour (0-23) from a time value.
time::minuteExtract the minute (0-59) from a time value.
time::secondExtract the second (0-59) from a time value.
time::nanosecondExtract the nanosecond component from a time value.
time::newCreate a new time from hour, minute, and second components.
time::nowGet the current time of day.
time::addAdd a duration to a time value.
time::subtractSubtract a duration from a time value.
time::diffCalculate the difference between two time values.
time::truncTruncate a time to a specified precision.
time::ageCalculate the elapsed duration from a time value until now.
time::formatFormat a time value as a string.