dateArithmetic

Description

Adds or subtracts some amount of time from a date, returning the resulting date. The field argument must be a string, and must be one of these options:

  • ms

  • second

  • sec

  • minute

  • hour

  • hr

  • day

  • week

  • month

  • year

Syntax

dateArithmetic( date, number, field )

Examples
 dateArithmetic(toDate("2010-01-04 8:00:00"), 5, "hour") //returns the date '2010-01-04 13:00:00'
 dateArithmetic({Root Container.DatePicker.date}, -8, "days") //returns a date eight days before the date in a Popup Calendar component.