add-years-to-dateTime

Adds the specified number of years to a given date and time.

Syntax

    add-years-to-dateTime(strDateTime1, years)

Parameters

strDateTime1 is a string that represents the date and time and is specified in the format yyyy-mm-ddThh:mm:ssZ . For more information about date and time parameters, see Date and time parameters .

years is a number that holds the number of years to add to the given date and time. A negative number for years subtracts years from the given date and time.

Returns

A string value in the format yyyy-mm-ddThh:mm:ssZ .

Example

The following expression returns a string value of 2001-11-28T11:12:00Z :

add-years-to-dateTime("1999-11-28T11:12:00Z",2)

// Ethnio survey code removed