Skip to main content

Module time

Module time 

Source
Expand description

Time frames, period conversions and date formatting.

Enums§

TimeFrame
Represents different timeframes for volatility calculations.

Functions§

convert_time_frame
Converts a value from one TimeFrame to another.
get_today_formatted
Returns the current date formatted as “dd-mmm-yyyy” in lowercase.
get_today_or_tomorrow_formatted
Formats the current date or the next day’s date based on the current UTC time.
get_tomorrow_formatted
Returns tomorrow’s date in “dd-mmm-yyyy” format (lowercase).
get_x_days_formatted
Formats a date a specified number of days from the current date.
get_x_days_formatted_pos
Returns a formatted date string representing the date x days in the future.
units_per_year
Returns how many units of the given TimeFrame fit into a calendar year as a Positive. Used by annualisation helpers (volatility, yield curves) to scale per-period values to a standardised annual basis.