Copy Code code as follows:
var dateto=new Date ("8:00 1/4/2014");
Gets the time object for the specified date, or the current time if it is empty.
Copy Code code as follows:
var date=dateto.gettime ()
Gets the number of milliseconds, starting and ending times at the time of 1970 years
Copy Code code as follows:
var y=date.getfullyear ();
Get year
Copy Code code as follows:
var mm=date.getmonth () +1;
Get month
Copy Code code as follows:
Get Date
Copy Code code as follows:
Get hours
Copy Code code as follows:
var m=date.getminutes ();
Get the number of minutes
Copy Code code as follows:
var s=date.getseconds ();
Get number of seconds
The countdown to the idea is to calculate the two time difference, and then use
SetInterval (); The corresponding function can be executed once per second
This procedure may also use the following functions:
parseint ($trNum);
This function converts a number of string types to a numeric type.