1. Date Object
Define a Time object:
Note : Use the first letter of the keyword New,date () to capitalize.
Makes udate a Date object and has an initial value: The current time (current computer system time).
2. Common methods of object date
Common methods for processing time and dates in a Date object:
3. Return to Week method
GetDay () returns a number of 0-6 in the week, 0 for Sunday. If you want to return the corresponding "week", complete with the array, the code is as follows:
<script type= "Text/javascript" > var mydate=new Date (); Define Date Object var weekday=["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; Defines the array object, assigns a value to each array item var mynum=mydate.getday ();//The return value is stored in the variable mynum document.write ( Mydate.getday ()); //Output GetDay () get
js-Object Use