<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function updateTime(){
var to=new Date("February 2,2011 00:00:00 EST");
// alert("totime="+to.getTime());
var now=new Date();
// alert("nowtime="+now.getTime());
var count=(to.getTime()-now.getTime())/1000;
// alert(count);
var s=Math.floor(count%60);
s=tostring(s);
count=count/60;
var min=Math.floor(count%60);
min=tostring(min)
count=count/60;
var hour=Math.floor(count%24);
var day=Math.floor(count/24);
var time=day+"天 "+hour+":"+min+":"+s;
window.document.getElementById("TextBox1").value=time;
setTimeout("updateTime()",1000);
}
function tostring(time){
if(time<10){
time="0"+time;
}
return time;
}
</script>
</head>
<body οnlοad="updateTime()">
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="距离2010农历年倒计时:" ForeColor="#FF3300"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" Height="20px" ReadOnly="True"
Width="144px"></asp:TextBox>
</div>
</form>
</body>
</html>