Date.add

Syntax

PP.Date.add(date, interval, value): Date;

Parameters

date. Date. Date

interval. PP.Date.interval. Unit of added time interval.

value. Number. Number of intervals.

Description

The add static method adds a time interval to date.

Comments

The method returns an object of the Date type.

Example

To execute the example, add a link to PP.js scenario file to HTML page.

// Create the current date
date = new Date();
// Add 5 days to the current date
newDate = PP.Date.add(date, PP.Date.Interval.Day, 5);
console.log(newDate);

After executing the example a new date is obtained.

See also:

PP