Skip to main content

Module time

Module time 

Source
Expand description

Time handling and formatting.

Structsยง

LocaleFormatCache ๐Ÿ”’
Cached locale-specific formatting properties.
TimeFormat
How to format the time stamps.
TimeFormatter
Formatter for time strings with caching of computed values. Enables efficient formatting of multiple time values with the same timescale and format settings.
TimeScale

Enumsยง

TimeStringFormatting
How to format the numeric part of the time string.
TimeUnit

Constantsยง

DEFAULT_TIMELINE_NAME
THIN_SPACE ๐Ÿ”’
TICK_STEPS
Candidate multipliers used to choose tick spacing.

Staticsยง

LOCALE_FORMAT_CACHE ๐Ÿ”’

Functionsยง

create_cache ๐Ÿ”’
find_auto_scale ๐Ÿ”’
Heuristically find a suitable time unit for the given time.
format_locale ๐Ÿ”’
format_si ๐Ÿ”’
get_locale_format_cache ๐Ÿ”’
Get the cached locale formatting properties.
get_ticks_internal ๐Ÿ”’
Get suitable tick locations for the current view port. The method is based on guessing the length of the time string and is inspired by the corresponding code in Matplotlib.
split_and_format_number ๐Ÿ”’
Format number based on TimeStringFormatting, i.e., possibly group digits together and use correct separator for each group.
strip_trailing_zeros_and_period ๐Ÿ”’
Get rid of trailing zeros if the string contains a ., i.e., being fractional If the resulting string ends with ., remove that as well.
time_string
Format the time string taking all settings into account. This function delegates to TimeFormatter which handles the Auto timeunit.
timeformat_menu
Draw the menu for selecting the time format.
timeunit_menu
Create menu for selecting preferred time unit.