Module time

Source
Expand description

The time module.

Modules§

calendar
The core Calendar trait. This module defines a Calendar type and its methods.
constants
Constants for calendars and holidays. This module defines calendar and holiday related constants.
countries
Calendars implemented for specific countries. calendars and holidays for different countries.
date_generation
Date generation rules.
date_rolling
Date rolling conventions and methods.
day_counting
Day counting conventions and methods.
frequency
Frequency of payments.
holiday
The Holiday trait. This module defines a Holiday type and its methods.
schedule
The Schedule type.
stub_generation
Stub generation rules.
utilities
Utility functions for working with dates and times. This module defines general calendar and holiday related functions.

Structs§

CalendarMetadata
Calendar metadata struct.
Holiday
Holiday type.
Schedule
Schedule struct.

Enums§

DateGenerationConvention
Date generation conventions.
DateRollingConvention
Date rolling business day conventions.
DayCountConvention
Day count conventions.
Frequency
Interest/coupon frequency per year. This is important in finance, as it determines the number of times a cash flow is paid in a year, and thus affects the present value of the cash flows.
StubGeneration
Stub generation rules.

Constants§

EASTER_MONDAYS
Easter Mondays for the years 1901-2199. The first row is for Western Easter, the second for Orthodox Easter.

Traits§

Calendar
Calendar trait.
DateRoller
Date roller trait for rolling coupon/payment dates according to a given convention.
DayCounter
DayCounter trait.
Scheduler
The Scheduler trait. This trait is used to generate schedules for a Calendar.

Functions§

contains_leap_year
Function to check if a range of years contains a leap year.
date_sequence
Function to generate a sequence of dates from a start date, end date.
days_between
Function to compute the number of days between two dates.
get_days_in_years_in_range
Function to get the number of days for each year in a range of Dates.
get_first_day_of_month
Function to get the first day of the month.
get_first_friday_of_month
Function to get the date of the first Friday of the month.
get_first_monday_of_month
Function to get the date of the first Monday of the month.
get_first_saturday_of_month
Function to get the date of the first Saturday of the month.
get_first_sunday_of_month
Function to get the date of the first Sunday of the month.
get_first_thursday_of_month
Function to get the date of the first Thursday of the month.
get_first_tuesday_of_month
Function to get the date of the first Tuesday of the month.
get_first_wednesday_of_month
Function to get the date of the first Wednesday of the month.
get_last_day_of_month
Function to get the last day of the month.
get_last_friday_of_month
Function to get the date of the last Friday of the month.
get_last_monday_of_month
Function to get the date of the last Monday of the month.
get_last_saturday_of_month
Function to get the date of the last Saturday of the month.
get_last_sunday_of_month
Function to get the date of the last Sunday of the month.
get_last_thursday_of_month
Function to get the date of the last Thursday of the month.
get_last_tuesday_of_month
Function to get the date of the last Tuesday of the month.
get_last_wednesday_of_month
Function to get the date of the last Wednesday of the month.
get_years_in_range
Function to get a list of the years in a range of Dates.
is_first_day_of_month
Function to check if Date is first day of the month.
is_last_day_of_february
Function to check if date is the last day of February.
is_last_day_of_month
Function to check if Date is last day of the month.
is_weekday
Check if the date is a weekday.
is_weekend
Checks if date is a weekend.
leap_year_count
Function to get the number of leap years in a range of Dates.
next_business_day
Function to get the next business day for a given date and calendar.
previous_business_day
Function to get the previous business day for a given date and calendar.
today
Retrieve today’s date (local time).
unpack_date
Unpacks a Date into a tuple in the following form:
year_fraction
Compute a default year fraction between two dates.