<!--
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_year_month_day" />
<meta itemprop="path" content="Stable" />
</div>

# tf_quant_finance.datetime.dates_from_year_month_day

<!-- 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 years, months and days.

```python
tf_quant_finance.datetime.dates_from_year_month_day(
    year, month, day, validate=True
)
```



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


#### Args:


* <b>`year`</b>: Tensor of int32 type. Elements should be positive.
* <b>`month`</b>: Tensor of int32 type of same shape as `year`. Elements should be in
  range `[1, 12]`.
* <b>`day`</b>: Tensor of int32 type of same shape as `year`. Elements should be in
  range `[1, 31]` and represent valid dates together with corresponding
  elements of `month` and `year` Tensors.
* <b>`validate`</b>: Whether to validate the dates.


#### Returns:

DateTensor object.


#### Example

```python
year = tf.constant([2015, 2017], dtype=tf.int32)
month = tf.constant([4, 12], dtype=tf.int32)
day = tf.constant([15, 30], dtype=tf.int32)
date_tensor = tff.datetime.dates_from_year_month_day(year, month, day)
```