Module: tf_quant_finance.datetime

Last updated: 2023-03-16.

Module: tf_quant_finance.datetime#

View source

Date-related utilities.

Modules#

periods module: Date periods.

utils module: Utilities for working with dates.

Classes#

class BusinessDayConvention: Conventions that determine how to roll dates that fall on holidays.

class BusinessDaySchedule: Generates schedules containing every business day in a period.

class DateTensor: Represents a tensor of dates.

class HolidayCalendar: Represents a holiday calendar.

class Month: Months. Values are one-based.

class PeriodTensor: Represents a tensor of time periods.

class PeriodType: Periods that can be added or subtracted from DateTensors.

class PeriodicSchedule: Defines an array of dates specified by a regular schedule.

class WeekDay: Named days of the week. Values are zero-based with Monday = 0.

class WeekendMask: Provides weekend masks for some of the common weekend patterns.

Functions#

convert_to_date_tensor(...): Converts supplied data to a DateTensor if possible.

create_holiday_calendar(...): Creates a holiday calendar.

dates_from_datetimes(...): Creates DateTensor from a sequence of Python datetime objects.

dates_from_np_datetimes(...): Creates DateTensor from a Numpy array of dtype datetime64.

dates_from_ordinals(...): Creates DateTensor from tensors of ordinals.

dates_from_tensor(...): Creates DateTensor from a single tensor containing years, months and days.

dates_from_tuples(...): Creates DateTensor from a sequence of year-month-day Tuples.

dates_from_year_month_day(...): Creates DateTensor from tensors of years, months and days.

daycount_actual_360(...): Computes the year fraction between the specified dates.

daycount_actual_365_actual(...): Computes the year fraction between the specified dates.

daycount_actual_365_fixed(...): Computes the year fraction between the specified dates.

daycount_actual_actual_isda(...): Computes the year fraction between the specified dates.

daycount_thirty_360_isda(...): Computes the year fraction between the specified dates.

random_dates(...): Generates random dates between the supplied start and end dates.