Js implementation countdown and time object, js countdown object
The code for implementing countdown in JS is as follows:
<! Doctype html>
The following figure shows the implementation result:
Timestamp:The number of milliseconds since January 1, January 1970: oDate. getTime (); // do not ask why I am from January 1, January 1970 to the present! Baidu!
Time object:
Time obtained:
var oDate = new Date(); oYear = oDate.getFullYear(); oMon = oDate.getMonth(); oDay = oDate.getDate(); oHou = oDate.getHours(); oMin = oDate.getMinutes(); oSec = oDate.getSeconds(); oWeek = oDate.getDay();
Set Time:
ODate. setFullYear (year, month, day); oDate. setMonth (month); oDate. setDate (day); oDate. setHours (hour, minute, second, millisecond); the time is automatically carried;
I hope you can give more valuable comments on these issues! Learn from each other! Learn from each other!