> ## 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: DateDiffMonths

> Calculate the number of whole months between two datetime values. Use DATEDIFFMONTHS for period calculations in Integrate.io ETL data pipelines.

## Description

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

## Syntax

`DateDiffMonths(end_datetime, start_datetime)`

## Arguments

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

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

## Examples

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

## 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.
