Skip to main content

Module timestamp

Module timestamp 

Source

Structs§

Timestamp
Timestamp represents the value of units(seconds/milliseconds/microseconds/nanoseconds) elapsed since UNIX epoch. The valid value range of Timestamp depends on it’s unit (all in UTC timezone):
UnitQuotient
The exact division of a timestamp value into a different unit: quotient * from_scale + remainder == value * to_scale with 0 <= remainder < from_scale. quotient is the value floored in to_unit; remainder == 0 iff the value is representable in to_unit.

Enums§

TimeUnit

Functions§

div_mod_units
Divides a value given in from_unit by to_unit, i.e. computes its value in to_unit exactly (floor division). Returns None if the quotient overflows i64.
naive_datetime_to_timestamp 🔒
Converts the naive datetime (which has no specific timezone) to a nanosecond epoch timestamp in UTC.
timestamp_unit_scale 🔒
Number of units in one second.