--- title: "date(a) - year(b)" slug: "date-substract-year" updated: 2026-08-13T08:11:28Z published: 2026-08-13T08:11:28Z canonical: "docs.lobstersoftware.com/date-substract-year" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # date(a) - year(b) This function subtracts **b** years from the given date **a**. If **b** is negative the number of years are added. ## Parameters | Parameter | Description | | --- | --- | | a | Date. | | b | Years to subtract. | ## Examples | Parameter a | Parameter b | Result | | --- | --- | --- | | 2005-01-01 | 1 | 2004-01-01 | | 2005-01-01 | -1 | 2006-01-01 |