Expand description
The time
module.
Modules§
- calendar
- The core
Calendar
trait. This module defines aCalendar
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 aHoliday
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§
- Calendar
Metadata - Calendar metadata struct.
- Holiday
- Holiday type.
- Schedule
- Schedule struct.
Enums§
- Date
Generation Convention - Date generation conventions.
- Date
Rolling Convention - Date rolling business day conventions.
- DayCount
Convention - 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.
- Stub
Generation - 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.
- Date
Roller - 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 aCalendar
.
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.