JS的服务器时间倒记时器
2007-07-17 17:06
134 查看
<%@ Page Language="C#" AutoEventWireup="true" %>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<%@ Import Namespace="System.Globalization" %>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<head runat="server">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<title>Dynamic Drive DHTML Scripts- Universal Countdown Script</title>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<link rel="stylesheet" type="text/css" href="../ddincludes/mainstyle.css" />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<style style="text/css">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
.lcdstyle...{ /**//*Example CSS to create LCD countdown look*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
background-color:black;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
color:lime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
font: bold 18px MS Sans Serif;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
padding: 3px;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
.lcdstyle sup...{ /**//*Example CSS to create LCD countdown look*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
font-size: 80%
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</style>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<script type="text/javascript">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**//***********************************************
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* Universal Countdown script- ?Dynamic Drive (http://www.dynamicdrive.com)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* This notice MUST stay intact for legal use
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
***********************************************/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
function cdLocalTime(container, servermode, offsetMinutes, targetdate, debugmode)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if (!document.getElementById || !document.getElementById(container)) return
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.container=document.getElementById(container)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="Server-Aspx")? '<%=DateTime.Now.ToString("MMMM dd, yyyy HH:mm:ss", new CultureInfo("en-US")) %>' : '<%=DateTime.Now.ToString("MMMM dd, yyyy HH:mm:ss", new CultureInfo("en-US")) %>'
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.localtime=this.serverdate=new Date(servertimestring)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.targetdate=new Date(targetdate)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.debugmode=(typeof debugmode!="undefined")? 1 : 0
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.timesup=false
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.localtime.setTime(this.serverdate.getTime()+offsetMinutes*60*1000) //add user offset to server time
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.updateTime()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
cdLocalTime.prototype.updateTime=function()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var thisobj=this
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.localtime.setSeconds(this.localtime.getSeconds()+1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
setTimeout(function()...{thisobj.updateTime()}, 1000) //update time every second
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
cdLocalTime.prototype.displaycountdown=function(baseunit, functionref)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.baseunit=baseunit
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.formatresults=functionref
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.showresults()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
cdLocalTime.prototype.showresults=function()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var thisobj=this
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var debugstring=(this.debugmode)? "<p style="background-color: #FCD6D6; color: black; padding: 5px"><big>Debug Mode on!</big><br /><b>Current Local time:</b> "+this.localtime.toLocaleString()+"<br />Verify this is the correct current local time, in other words, time zone of count down date.<br /><br /><b>Target Time:</b> "+this.targetdate.toLocaleString()+"<br />Verify this is the date/time you wish to count down to (should be a future date).</p>" : ""
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var timediff=(this.targetdate-this.localtime)/1000 //difference btw target date and current date, in seconds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (timediff<0)...{ //if time is up
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.timesup=true
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.container.innerHTML=debugstring+this.formatresults()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var oneMinute=60 //minute unit in seconds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var oneHour=60*60 //hour unit in seconds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var oneDay=60*60*24 //day unit in seconds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var dayfield=Math.floor(timediff/oneDay)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (this.baseunit=="hours")...{ //if base unit is hours, set "hourfield" to be topmost level
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hourfield=dayfield*24+hourfield
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dayfield="n/a"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else if (this.baseunit=="minutes")...{ //if base unit is minutes, set "minutefield" to be topmost level
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
minutefield=dayfield*24*60+hourfield*60+minutefield
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dayfield=hourfield="n/a"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else if (this.baseunit=="seconds")...{ //if base unit is seconds, set "secondfield" to be topmost level
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var secondfield=timediff
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dayfield=hourfield=minutefield="n/a"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.container.innerHTML=debugstring+this.formatresults(dayfield, hourfield, minutefield, secondfield)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
setTimeout(function()...{thisobj.showresults()}, 1000) //update results every second
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**//////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW//////////////////////////////
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Create your own custom format function to pass into cdLocalTime.displaycountdown()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Use arguments[0] to access "Days" left
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Use arguments[1] to access "Hours" left
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Use arguments[2] to access "Minutes" left
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Use arguments[3] to access "Seconds" left
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//The values of these arguments may change depending on the "baseunit" parameter of cdLocalTime.displaycountdown()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//1) Display countdown using plain text
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
function formatresults()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (this.timesup==false)...{//if target date/time not yet met
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var displaystring="<span style='background-color: #CFEAFE'>"+arguments[1]+" hours "+arguments[2]+" minutes "+arguments[3]+" seconds</span> left until April 23, 2008 2:30:25 Pacific Time (GMT-8)"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{ //else if target date/time met
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var displaystring="Launch time!"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return displaystring
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//2) Display countdown with a stylish LCD look, and display an alert on target date/time
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
function formatresults2()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (this.timesup==false)...{ //if target date/time not yet met
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var displaystring="<span class='lcdstyle'>"+arguments[0]+" <sup>days</sup> "+arguments[1]+" <sup>hours</sup> "+arguments[2]+" <sup>minutes</sup> "+arguments[3]+" <sup>seconds</sup></span> left until April 23, 2010 15:53:00 Pacific Time (GMT-8)"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{ //else if target date/time met
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var displaystring="" //Don't display any text
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
alert("Launch time!") //Instead, perform a custom alert
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return displaystring
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</head>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<form runat="server">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id="cdcontainer"></div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id="cdcontainer2" style="margin: 10px 0 1em 0;"></div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<script type="text/javascript">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//cdLocalTime("ID_of_DIV_container", "server_mode", LocaltimeoffsetMinutes, "target_date", "opt_debug_mode")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//cdLocalTime.displaycountdown("base_unit", formatfunction_reference)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
var launchdate=new cdLocalTime("cdcontainer", "None", 0, "April 23, 2008 2:30:25")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
launchdate.displaycountdown("hours", formatresults)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
var launchdate2=new cdLocalTime("cdcontainer2", "Server-Aspx", 0, "April 23, 2008 2:30:25")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
launchdate2.displaycountdown("days", formatresults2)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</form>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</html>
转自 http://blog.csdn.net/sibyle/archive/2007/06/11/1647794.aspx
来源 http://www.dynamicdrive.com/dynamicindex6/universalcountdown.htm
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<%@ Import Namespace="System.Globalization" %>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<head runat="server">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<title>Dynamic Drive DHTML Scripts- Universal Countdown Script</title>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<link rel="stylesheet" type="text/css" href="../ddincludes/mainstyle.css" />
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<style style="text/css">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
.lcdstyle...{ /**//*Example CSS to create LCD countdown look*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
background-color:black;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
color:lime;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
font: bold 18px MS Sans Serif;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
padding: 3px;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
.lcdstyle sup...{ /**//*Example CSS to create LCD countdown look*/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
font-size: 80%
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</style>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<script type="text/javascript">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**//***********************************************
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* Universal Countdown script- ?Dynamic Drive (http://www.dynamicdrive.com)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* This notice MUST stay intact for legal use
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
***********************************************/
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
function cdLocalTime(container, servermode, offsetMinutes, targetdate, debugmode)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if (!document.getElementById || !document.getElementById(container)) return
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.container=document.getElementById(container)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var servertimestring=(servermode=="server-php")? '<? print date("F d, Y H:i:s", time())?>' : (servermode=="Server-Aspx")? '<%=DateTime.Now.ToString("MMMM dd, yyyy HH:mm:ss", new CultureInfo("en-US")) %>' : '<%=DateTime.Now.ToString("MMMM dd, yyyy HH:mm:ss", new CultureInfo("en-US")) %>'
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.localtime=this.serverdate=new Date(servertimestring)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.targetdate=new Date(targetdate)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.debugmode=(typeof debugmode!="undefined")? 1 : 0
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.timesup=false
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.localtime.setTime(this.serverdate.getTime()+offsetMinutes*60*1000) //add user offset to server time
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.updateTime()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
cdLocalTime.prototype.updateTime=function()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var thisobj=this
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.localtime.setSeconds(this.localtime.getSeconds()+1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
setTimeout(function()...{thisobj.updateTime()}, 1000) //update time every second
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
cdLocalTime.prototype.displaycountdown=function(baseunit, functionref)...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.baseunit=baseunit
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.formatresults=functionref
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.showresults()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
cdLocalTime.prototype.showresults=function()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var thisobj=this
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var debugstring=(this.debugmode)? "<p style="background-color: #FCD6D6; color: black; padding: 5px"><big>Debug Mode on!</big><br /><b>Current Local time:</b> "+this.localtime.toLocaleString()+"<br />Verify this is the correct current local time, in other words, time zone of count down date.<br /><br /><b>Target Time:</b> "+this.targetdate.toLocaleString()+"<br />Verify this is the date/time you wish to count down to (should be a future date).</p>" : ""
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var timediff=(this.targetdate-this.localtime)/1000 //difference btw target date and current date, in seconds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (timediff<0)...{ //if time is up
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.timesup=true
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.container.innerHTML=debugstring+this.formatresults()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var oneMinute=60 //minute unit in seconds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var oneHour=60*60 //hour unit in seconds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var oneDay=60*60*24 //day unit in seconds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var dayfield=Math.floor(timediff/oneDay)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (this.baseunit=="hours")...{ //if base unit is hours, set "hourfield" to be topmost level
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
hourfield=dayfield*24+hourfield
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dayfield="n/a"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else if (this.baseunit=="minutes")...{ //if base unit is minutes, set "minutefield" to be topmost level
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
minutefield=dayfield*24*60+hourfield*60+minutefield
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dayfield=hourfield="n/a"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else if (this.baseunit=="seconds")...{ //if base unit is seconds, set "secondfield" to be topmost level
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var secondfield=timediff
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
dayfield=hourfield=minutefield="n/a"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
this.container.innerHTML=debugstring+this.formatresults(dayfield, hourfield, minutefield, secondfield)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
setTimeout(function()...{thisobj.showresults()}, 1000) //update results every second
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
/**//////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW//////////////////////////////
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Create your own custom format function to pass into cdLocalTime.displaycountdown()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Use arguments[0] to access "Days" left
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Use arguments[1] to access "Hours" left
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Use arguments[2] to access "Minutes" left
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//Use arguments[3] to access "Seconds" left
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//The values of these arguments may change depending on the "baseunit" parameter of cdLocalTime.displaycountdown()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//1) Display countdown using plain text
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
function formatresults()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (this.timesup==false)...{//if target date/time not yet met
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var displaystring="<span style='background-color: #CFEAFE'>"+arguments[1]+" hours "+arguments[2]+" minutes "+arguments[3]+" seconds</span> left until April 23, 2008 2:30:25 Pacific Time (GMT-8)"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{ //else if target date/time met
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var displaystring="Launch time!"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return displaystring
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//2) Display countdown with a stylish LCD look, and display an alert on target date/time
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
function formatresults2()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
if (this.timesup==false)...{ //if target date/time not yet met
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var displaystring="<span class='lcdstyle'>"+arguments[0]+" <sup>days</sup> "+arguments[1]+" <sup>hours</sup> "+arguments[2]+" <sup>minutes</sup> "+arguments[3]+" <sup>seconds</sup></span> left until April 23, 2010 15:53:00 Pacific Time (GMT-8)"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
else...{ //else if target date/time met
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var displaystring="" //Don't display any text
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
alert("Launch time!") //Instead, perform a custom alert
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return displaystring
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</head>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<form runat="server">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id="cdcontainer"></div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id="cdcontainer2" style="margin: 10px 0 1em 0;"></div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<script type="text/javascript">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//cdLocalTime("ID_of_DIV_container", "server_mode", LocaltimeoffsetMinutes, "target_date", "opt_debug_mode")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
//cdLocalTime.displaycountdown("base_unit", formatfunction_reference)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
var launchdate=new cdLocalTime("cdcontainer", "None", 0, "April 23, 2008 2:30:25")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
launchdate.displaycountdown("hours", formatresults)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
var launchdate2=new cdLocalTime("cdcontainer2", "Server-Aspx", 0, "April 23, 2008 2:30:25")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
launchdate2.displaycountdown("days", formatresults2)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</form>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</body>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</html>
转自 http://blog.csdn.net/sibyle/archive/2007/06/11/1647794.aspx
来源 http://www.dynamicdrive.com/dynamicindex6/universalcountdown.htm
相关文章推荐
- js获取本地时间、服务器时间、倒计时
- js获取服务器时间戳
- js获取服务器时间
- js实时获取服务器时间
- js获取服务器时间
- 使用js获取服务器时间
- JS 获取服务器时间
- js获得服务器时间并实时更新
- js基于服务器时间的倒计时功能
- html+js 在页面同步服务器时间
- JS 服务器系统时间
- js 倒计时插件(服务器时间,终端时间供选择)
- js获取服务器当前时间
- JS倒计时程序获取准确服务器时间的几种方式
- js向服务器发送请求,获取服务器时间
- 一段JS的服务器时间倒记时器
- js获取当前服务器时间并动态刷新
- js的倒计时 服务器时间与本地时间不一致
- [原创]实现与服务器时间同步的跨平台JS脚本 支持IE , firefox , Opera ,Netscape 等主流浏览器
- js基于服务器时间的倒计时功能