--- title: "add*" description: "Add or subtract an amount to a given date and time" --- # add* > Add or subtract an amount to a given date and time **This function is used by Ignition's Expression language.** ## Description This function is a set of functions that include: | Function | Description | |---|---| | addMillis | Add or subtract an amount of milliseconds to a given date and time. | | addSeconds | Add or subtract an amount of seconds to a given date and time. | | addMinutes | Add or subtract an amount of minutes to a given date and time. | | addHours | Add or subtract an amount of hours to a given date and time. | | addDays | Add or subtract an amount of days to a given date and time. | | addWeeks | Add or subtract an amount of weeks to a given date and time. | | addMonths | Add or subtract an amount of months to a given date and time. This function is unique since each month can have a variable number of days. For example, if the date passed in is March 31st, and we add one month, April does not have a 31st day, so the returned date will be the proper number of months rounded down to the closest available day, in this case April 30th. | | addYears | Add or subtract an amount of years to a given date and time. | ## Syntax `add*(date, value)` ### Parameters | Type | Parameter | Description | |---------|-----------|---------------------------------------------------------------------------------------------------| | Date | `date` | The starting date. | | Integer | `value` | The amount of units to change the date by, where the units depend on the specific function used. | ### Returns **Date** - A new date that has been adjusted by the specified amount. ## Examples ```python title="Code Snippet" addWeeks(now(), 2) //Adds 2 weeks to the current time ``` ```python title="Code Snippet" addDays(now(), -5) //Subtracts 5 days from the current time. ``` ```python title="Code Snippet" addHours({Root Container.Calendar.date}, 5) //This example would add 5 hours to the date passed in from a calendar component ```