August 1999
Intermediate to advanced
1488 pages
72h 53m
English
date.setDate(day)
The setDate() method sets the day of the month in the Date object to the argument day, an integer from 1 to 31. The method returns an integer representing the number of milliseconds between midnight January 1, 1970 (GMT) to the date and time specified in the Date object after the day of the month has been adjusted.
Caution
Prior to JavaScript 1.2, this method returned nothing.
The code in Listing 6.92 displays the current date in milliseconds before setting the day to 4. Notice that the milliseconds specified after the setDate() method are the same as the result returned from the method.
Read now
Unlock full access