> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: DateDiffYears

> Calculate the number of whole years between two datetime values. Use DATEDIFFYEARS for age and tenure calculations in Integrate.io ETL pipelines.

## Description

Returns the number of years between the end\_datetime and the start\_datetime.

## Syntax

`DateDiffYears(end_datetime, start_datetime)`

## Arguments

*end\_datetime* - string expression in ISO 8601 format.

*start\_datetime* - string expression in ISO 8601 format.

## Examples

`DateDiffYears(`'2009-01-07T01:07:01.000Z','2008-02-01T00:00:00.000Z'`)` returns 0

## Notes

end\_datetime and start\_datetime must be in ISO 8601 date time format, otherwise the job will fail. See [Using ISO 8601 date/time functions](/etl/using-iso-8601-string-functions/).

## Return value datatype

Long

## Impact of null value

If any (or all) inputs are null, returns null.
