<!--
This file is generated by a tool. Do not edit directly.
For open-source contributions the docs will be updated automatically.
-->

*Last updated: 2023-03-16.*

<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tf_quant_finance.datetime.dates_from_ordinals" />
<meta itemprop="path" content="Stable" />
</div>

# tf_quant_finance.datetime.dates_from_ordinals

<!-- Insert buttons and diff -->

<table class="tfo-notebook-buttons tfo-api" align="left">
</table>

<a target="_blank" href="https://github.com/paolodelia99/tf-quant-finance/blob/main/tf_quant_finance/datetime/date_tensor.py">View source</a>



Creates DateTensor from tensors of ordinals.

```python
tf_quant_finance.datetime.dates_from_ordinals(
    ordinals, validate=True
)
```



<!-- Placeholder for "Used in" -->


#### Args:


* <b>`ordinals`</b>: Tensor of type int32. Each value is number of days since 1 Jan
  0001. 1 Jan 0001 has `ordinal=1`.
* <b>`validate`</b>: Whether to validate the dates.


#### Returns:

DateTensor object.


#### Example

```python
ordinals = tf.constant([
  735703,  # 2015-4-12
  736693   # 2017-12-30
], dtype=tf.int32)

date_tensor = tff.datetime.dates_from_ordinals(ordinals)
```