The result of this method will be the new time value of the containing object having been adjusted by the values passed in as arguments.
The calculations are performed according to local time coordinates.
<HTML> <HEAD> </HEAD> <BODY> <SCRIPT> myArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); myDate = new Date(); myDate.setDate(1); document.write("The first day of this month is a " + myArray[myDate.getDay()]); </SCRIPT> </BODY> </HTML>
See also: | Date.getDate(), Date.prototype |
Prev | Home | Next |
Date.prototype | Up | Date.setFullYear() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |