Skip to main content

Module util

Module util 

Source
Expand description

Utility functions, including updating time zone information.

Modulesยง

local_offset ๐Ÿ‘ป Deprecatedlocal-offset
range_validated ๐Ÿ”’
Versions of functions that are optimized for when the year has already been range-validated.

Enumsยง

DateAdjustment ๐Ÿ”’
Whether to adjust the date, and in which direction. Useful when implementing arithmetic.

Functionsยง

days_in_month
Get the number of days in the month of a given year.
days_in_month_leap ๐Ÿ”’
Get the number of days in the month. The year does not need to be known, but whether the year is a leap year does.
days_in_year
Get the number of calendar days in a given year.
days_in_year_monthDeprecated
Get the number of days in the month of a given year.
is_leap_year
Returns if the provided year is a leap year in the proleptic Gregorian calendar. Uses astronomical year numbering.
refresh_tzlocal-offset
Attempt to update time zone information from the system.
refresh_tz_uncheckedโš local-offset
Update time zone information from the system.
weeks_in_year
Get the number of weeks in the ISO year.