DateAdd2

Adds the specified value for the specified date or time part to a string representation of a date, time, or datetime.

DateAdd2(dateTimeString, value, datePart) β†’ modifiedDateTimeString

Inputs

  • dateTimeString - A string representing a date, time, or datetime value.

  • value - The number of units of time that you want to add.

  • datePart - The units of time that you want to add, ex. DateValueOption.DAY.

Examples

DateAdd2("2021-01-04", 2, DateValueOption.MONTH) β†’ "2021-03-04"
DateAdd2("2023-01-30", 7, DateValueOption.DAY) β†’ "2023-02-06"
DateAdd2("15:30:00", 1, DateValueOption.HOUR) β†’ "16:30:00"
DateAdd2("2023-10-15 12:45:30", -5, DateValueOption.MINUTE) β†’ "2023-10-15 12:40:30"

Last updated