tf_quant_finance.datetime.utils.ordinal_to_year_month_day

Contents

Last updated: 2023-03-16.

tf_quant_finance.datetime.utils.ordinal_to_year_month_day#

View source

Calculates years, months and dates Tensor given ordinals Tensor.

tf_quant_finance.datetime.utils.ordinal_to_year_month_day(
    ordinals
)

Args:#

  • ordinals: Tensor of int32 type. Each element is number of days since 1 Jan

  1. 1 Jan 0001 has ordinal = 1.

Returns:#

Tuple (years, months, days), each element is an int32 Tensor of the same shape as ordinals. months and days are one-based.