Module utils

Source
Expand description

Utils crate where common behaviour for computing dates are shared

Functionsยง

get_datetime_and_unit_from_units
get_hms_from_timestamp
Converts a timestamp into hours, minutes, and seconds.
get_timestamp_from_hms
Converts the given hour, minute, and second values into a timestamp.
get_timestamp_from_ymd
Calculates the timestamp from the given year, month, and day.
get_ymd_hms_from_timestamp
Converts a timestamp to the year, month, day, hour, minute, and second components.
is_leap_gregorian
Determines if a given year is a leap year according to the Gregorian calendar.
is_leap_julian
Determines if a given year is a leap year in the Julian calendar.
normalize_nanoseconds
Normalize the given number of nanoseconds into seconds and remaining nanoseconds.
unit_to_encode
Converts a unit of time to its corresponding encoded value.