<SCRIPT><!--// Script Editor: Howard Chen // Browser Compatible for this script: IE 2.0 or Higher // Netscape 2.0 or Higher // Get more JavaScripts at http://www.geocities.com/SiliconValley/Network/7432/ // Bug report to [email protected] // This script is free as long as you keep its creditsvar theDay = new Date("June 21, 2004") //The day has to be in the format Month Day, Yearvar DayTill //The string that is going to put all numbers together and make sense.function countdown(){var today = new Date() //Create an Date Object that contains today's date.var second = Math.floor((theDay.getTime() - today.getTime())/1000)var minute = Math.floor(second/60) //Devide "second" into 60 to get the minutevar hour = Math.floor(minute/60) //Devide "minute" into 60 to get the hourvar day = Math.floor(hour/24) //Devide "hour" into 60 to get the dayCDay= day //Correct dayCHour= hour % 24 //Correct hour, after devide into 24, the remainder deposits here.CMinute= minute % 60 //Correct minute, after devide into 60, the remainder deposits here.CSecond= second % 60 //Correct second, after devide into 60, the remainder deposits here.DayTill = CDay + " days, " + CHour + " hours, " + CMinute + " minutes and " + CSecond + " seconds "//Rewrite the string to the correct information.document.clock.countdown.value = DayTill //Make the particular form chart become "Daytill"var counter = setTimeout("countdown()", 1000)}//--></SCRIPT>时间差的js,在asp中通用!
// Browser Compatible for this script: IE 2.0 or Higher
// Netscape 2.0 or Higher
// Get more JavaScripts at http://www.geocities.com/SiliconValley/Network/7432/
// Bug report to [email protected]
// This script is free as long as you keep its creditsvar theDay = new Date("June 21, 2004") //The day has to be in the format Month Day, Yearvar DayTill //The string that is going to put all numbers together and make sense.function countdown(){var today = new Date() //Create an Date Object that contains today's date.var second = Math.floor((theDay.getTime() - today.getTime())/1000)var minute = Math.floor(second/60) //Devide "second" into 60 to get the minutevar hour = Math.floor(minute/60) //Devide "minute" into 60 to get the hourvar day = Math.floor(hour/24) //Devide "hour" into 60 to get the dayCDay= day //Correct dayCHour= hour % 24 //Correct hour, after devide into 24, the remainder deposits here.CMinute= minute % 60 //Correct minute, after devide into 60, the remainder deposits here.CSecond= second % 60 //Correct second, after devide into 60, the remainder deposits here.DayTill = CDay + " days, " + CHour + " hours, " + CMinute + " minutes and " + CSecond + " seconds "//Rewrite the string to the correct information.document.clock.countdown.value = DayTill //Make the particular form chart become "Daytill"var counter = setTimeout("countdown()", 1000)}//--></SCRIPT>时间差的js,在asp中通用!