Date class is used to process dates and times based on the number of milliseconds (timestamp) since January 1, 1970 (World Standard Time)
1. Create Date Object
var now = new Date ();//Current time var date = new Date (1000);//As of January 1, 1970 the second time var date = new Date (year,month,day,hour,minute,sec Ond,millisecond);//Create a Date object by specifying each time component separately
2, the method provided
GetTime () Gets the timestamp on which a Date object is based
A series of getter/setter methods are also provided to manipulate the various time components, such as gethours ()
Note: The return value in addition to GetMonth () (Get month) is starting at 0 and the rest is starting from 1
Example
<! doctype html public "-//w3c//dtd html 4.01 transitional//en" "HTTP// Www.w3.org/TR/html4/loose.dtd ">650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/86/9D/wKiom1fFWTjBe_jyAAJrgPdBk38976.gif "title=" Date.gif "alt=" Wkiom1ffwtjbe_jyaajrgpdbk38976.gif "/>
The date in JavaScript