Time object is an object that we often want to use, whether it is to do time output, time judgment and other operations are inseparable from this object. In addition to the time objects in JavaScript, there are a lot of time objects in VBScript, and they are very useful. Follow our process to explain the date function in JavaScript.
New Date ()
New Date (milliseconds)
New Date (datestring)
New Date (year, month)
New Date (year, month, day)
New Date (year, month, day, hours)
New Date (year, month, day, hours, minutes)
New Date (year, month, day, hours, minutes, seconds)
New Date (year, month, day, hours, minutes, seconds, microseconds)
Under the face
1.new date (), when there are no parameters, the current time Date object is created.
2.new Date (milliseconds), when the parameter is a number, then this parameter is a timestamp, is treated as a millisecond, creating a time Date object that is specified in milliseconds from January 1, 1970.
3.new Date (datestring), this parameter is a string, and this string must be able to use Date.parse () conversion.
4. The following six constructors are precisely defined:
1. Year, is an integer, if it is 0-99, then add 1900 on this basis, the others are returned as is.
2). Month, is an integer, the range is 0-11.
3. Day, is an integer, the range is 1-31.
4). Hours, is an integer, the range is 0-23.
5). Minutes, is an integer, the range is 0-59.
6). Seconds, is an integer, the range is 0-59.
7. Microseconds is an integer, the range is 0-9999.