Standard Library
std.time
Time helpers for tool-style scripts.
Exported functions
Return the current UTC timestamp.
Return the current Unix timestamp in seconds.
Return the current Unix timestamp in milliseconds.
Pause the current thread for the specified number of milliseconds.
Pause the current thread for a duration value.
Construct a timestamp from Unix seconds.
Construct a timestamp from Unix milliseconds.
Return the Unix seconds for a timestamp.
Return the Unix milliseconds for a timestamp.
Create a duration in milliseconds.
Create a duration in seconds.
Create a duration in minutes.
Create a duration in hours.
Create a duration in days.
Return the sum of two durations.
Return the difference between two durations.
Multiply a duration by an integer factor.
Return the elapsed duration between two timestamps.
Add a duration to a timestamp.
Subtract a duration from a timestamp.
Format a timestamp as an RFC3339 string in UTC.
Parse an RFC3339 string into a timestamp.
Parse an RFC3339 string and panic on invalid input.
Break a timestamp into UTC calendar components. Weekday is ISO numbering: 1 = Monday through 7 = Sunday.
Return the UTC year of a timestamp.
Return the UTC month (1-12) of a timestamp.
Return the UTC day of month (1-31) of a timestamp.
Return the UTC hour (0-23) of a timestamp.
Return the UTC minute (0-59) of a timestamp.
Return the UTC second (0-59) of a timestamp.
Return the ISO weekday (1 = Monday .. 7 = Sunday) of a timestamp.
Format a timestamp with a format description such as "[year]-[month]-[day] [hour]:[minute]:[second]".
Format a timestamp with a format description, panicking on failure.
Parse text with a format description into a UTC timestamp. Patterns without an offset are interpreted as UTC.
Parse text with a format description, panicking on failure.
Build a UTC timestamp from calendar components.
Build a UTC timestamp from calendar components, panicking on failure.
Format a timestamp as "YYYY-MM-DD" in UTC.
Format a timestamp as "HH:MM:SS" in UTC.