dateAdd(interval, amount, date)

Returns a new date that is created by adding the specified amount of time to the specified interval of the given date.

Parameters

interval The date interval to be modified.

amount The amount of time to be added to the interval

date The date to be modified

Example

dateAdd('m', 2, new Date())

// newDate is set to be 2 months from the current date.

All the valid date interval strings are listed in the table below.

interval strings

date interval it represents

yyyy

Year

q

Quarter

m

Month

y

Day of the year

d

Day of the month

w

Day of the week

ww

Week of the year

h

Hour

n

Minute

s

Second

<< toTimeString() © 1996-2013 InetSoft Technology Corporation (v11.5) dateDiff(interval, date1, date2) >>