Set Date Method
The Set Date method sets the day of dateVar to the value you specify in the dayOfMonth argument.
Format
dateVar.setDate(dayOfMonth)
The following table describes the arguments for the Set Date method.
Argument | Description |
---|---|
dayOfMonth |
The day of the month to set in dateVar as an integer from 1 through 31. For more information, see Values for Dates and Times. |
Setting the Day to a Value That Exceeds 31
You can add any number of days to a date. Siebel eScript automatically converts the number of days to the correct month and year. For example, to add the number of days to a date, you can use the following script:
//script to add 7 days to a date
var dtNextWeek = new Date();
dtNextWeek.setDate( dtNextWeek.getDate()+7 );
//script to add 76 days to a date
var dtNextWeek = new Date();
dtNextWeek.setDate(dtNextWeek.getDate()+76);