var dateTo=new Date("8:00 1/ 4/2014");
Get the time object of the specified date. If it is empty, it defaults to the current time.
var date=dateTo.getTime()
Get the number of milliseconds, starting and ending in 1970
var y=date.getFullYear();
Get the year
var mm=date.getMonth() 1;
Get the month
var d=date.getDate();
Get date
var h=date.getHours();
Get the hours
var m=date.getMinutes();
Get the minutes
var s= date.getSeconds();
Get seconds
The idea of countdown is to calculate the time difference between two times, and then use
setInterval(); just execute the corresponding function once per second
This process may also use the following functions:
parseInt($trNum);
This function converts string type numbers into numeric types.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn