Examples:
-
addSeconds(2016-12-08T15:55:57.536Z;2)
Returns 2016-12-08T15:55:59.536Z
-
addSeconds(2016-12-08T15:55:57.536Z;-2)
Returns 2016-12-08T15:55:55.536Z
addMinutes (date; number)
Returns a new date as a result of adding a given number of minutes to a date. To subtract minutes, enter a negative number.
Examples:
-
addMinutes(2016-12-08T15:55:57.536Z;2)
Returns 2016-12-08T15:57:57.536Z
-
addMinutes(2016-12-08T15:55:57.536Z;-2)
Returns 2016-12-08T15:53:57.536Z
addHours (date; number)
Returns a new date as a result of adding a given number of hours to a date. To subtract hours, enter a negative number.
Examples:
-
addHours(2016-12-08T15:55:57.536Z; 2)
Returns 2016-12-08T17:55:57.536Z
-
addHours(2016-12-08T15:55:57.536Z;-2)
Returns 2016-12-08T13:55:57.536Z
addDays (date; number)
Returns a new date as a result of adding a given number of days to a date. To subtract days, enter a negative number.
Examples:
-
addDays(2016-12-08T15:55:57.536Z;2)
Returns 2016-12-10T15:55:57.536Z
-
addDays(2016-12-08T15:55:57.536Z;-2)
Returns 2016-12-6T15:55:57.536Z
addMonths (date; number)
Returns a new date as a result of adding a given number of months to a date. To subtract months, enter a negative number.
Examples:
-
addMonths(2016-08-08T15:55:57.536Z;2)
Returns 2016-10-08T15:55:57.536Z
-
addMonths(2016-08-08T15:55:57.536Z;-2)
Returns 2016-06-08T15:55:57.536Z
addYears (date; number)
Returns a new date as a result of adding a given number of years to a date. To subtract years, enter a negative number.
Examples:
-
addYears(2016-08-08T15:55:57.536Z;2)
Returns 2018-08-08T15:55:57.536Z
-
addYears(2016-12-08T15:55:57.536Z; -2)
Returns 2014-08-08T15:55:57.536Z
setSecond (date; number)
This function returns a new date with the seconds specified in parameters.
Specify a number from 0 to 59. If the number is outside of that range, the function returns a second from the previous minute (for a negative number) or subsequent minute (for a positive number).
If you need to specify a number outside the range, we recommend that you use addSeconds, as described above in the section addSeconds (date; number).
Examples:
-
setSecond(2015-10-07T11:36:39.138Z;10)
Returns 2015-10-07T11:36:10.138Z
-
setSecond(2015-10-07T11:36:39.138Z; 61)
Returns 2015-10-07T11:37:01.138Z
setMinute (date; number)
This function returns a new date with the minutes specified in parameters.
Specify a number from 0 to 59. If the number is outside of that range, the function returns a minute from the previous hour (for a negative number) or subsequent hour (for a positive number).
If you need to specify a number outside the range, we recommend that you use addMinutes, as described above in addMinutes (date; number).
Examples:
-
setMinute(2015-10-07T11:36:39.138Z;10)
Returns 2015-10-07T11:10:39.138Z
-
setMinute(2015-10-07T11:36:39.138Z;61)
Returns 2015-10-07T12:01:39.138Z
setHour (date; number)
This function returns a new date with the hour specified in parameters.
Specify a number from 0 to 23. If the number is outside this range, the function returns an hour from the previous day (for a negative number) or subsequent day (for a positive number).
If you need to specify a number outside the range, we recommend that you use addHours, as described above in addHours (date; number).
Examples:
-
setHour(2015-08-07T11:36:39.138Z;6)
Returns 2015-08-07T06:36:39.138Z
-
setHour(2015-08-07T11:36:39.138;-6)
Returns 2015-08-06T18:36:39.138Z
setDay (date; number/name of the day in English)
This function returns a new date with the day specified in parameters.
You can use this function to set the day of the week, with Sunday as 1 and Saturday as 7. If the you specify a number from 1 to 7, the resulting date is within the current (Sunday-to-Saturday) week. If the number is outside of that range, the function returns a day from the previous week (for a negative number) or subsequent week (for a positive number).
If you need to specify a number outside the range, we recommend that you use addDays, as described above in addDays (date; number).
Examples:
-
setDay(2018-06-27T11:36:39.138Z;Monday)
Returns 2018-06-25T11:36:39.138Z
-
setDay(2018-06-27T11:36:39.138Z;1)
Returns 2018-06-24T11:36:39.138Z
-
setDay(2018-06-27T11:36:39.138Z;7)
Returns 2018-06-30T11:36:39.138Z
setDate (date; number)
This function returns a new date with the day of the month specified in parameters.
Specify a number from 1 to 31. If the number is outside of this range, the function returns a day from the previous month (for a negative number) or subsequent month (for a positive number).
Examples:
-
setDate(2015-08-07T11:36:39.138Z;5)
Returns 2015-08-05T11:36:39.138Z
-
setDate(2015-08-07T11:36:39.138Z;32)
Returns 2015-09-01T11:36:39.138Z
setMonth (date; number/name of the month in English)
This function returns a new date with the month specified in parameters.
Specify a number from 1 to 12. If the number is outside of this range, the function returns the month in the previous year (for a negative number) or subsequent year (for a positive number).
Examples:
-
setMonth(2015-08-07T11:36:39.138Z;5)
Returns 2015-05-07T11:36:39.138Z
-
setMonth(2015-08-07T11:36:39.138Z;17)
Returns 2016-05-07T11:36:39.138Z
-
setMonth(2015-08-07T11:36:39.138Z;january)
Returns 2015-01-07T12:36:39.138Z
setYear (date; number)
Returns a new date with the year specified in parameters.
Example:
-
setYear(2015-08-07T11:36:39.138Z;2017)
Returns 2017-08-07T11:36:39.138Z