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

# tf_quant_finance.datetime.utils.days_in_leap_and_nonleap_years_between

<!-- 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_utils.py">View source</a>



Calculates number of days that fall on leap and non-leap years.

```python
tf_quant_finance.datetime.utils.days_in_leap_and_nonleap_years_between(
    start_date, end_date
)
```



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

Calculates a tuple '(days_in_leap_years, days_in_nonleap_years)'.
'start_date' is included and 'end_date' is excluded from the period.

For example, for dates `2019-12-24` and `2024-2-10` the result is
(406, 1103):
406 = 366 days in 2020 + 31 in Jan 2024 + 9 in Feb 2024,
1103 = 8 in 2019 + 365 in 2021 + 365 in 2022 + 365 in 2023.

If `end_date` is earlier than `start_date`, the result will be negative or
zero.

#### Args:


* <b>`start_date`</b>: DateTensor.
* <b>`end_date`</b>: DateTensor compatible with `start_date`.


#### Returns:

Tuple of two Tensors of type 'int32'.
