# addyears - script and chart function

This function returns the date occurring n years after startdate or, if n is negative, the date occurring n years before startdate.

Syntax:

AddYears(startdate, n)

**Return data type:** dual

Arguments:

AddYears arguments

| Argument | Description |
| --- | --- |
| startdate | The start date as a time stamp, for example '2012-10-12'. |
| n | Number of years as a positive or negative integer. |

Examples and results:

Examples and results

| Example | Result |
| --- | --- |
| `addyears ('2010-01-29',3)` | returns '2013-01-29' |
| `addyears ('2010-01-29',-1)` | returns '2009-01-29' |