<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="BookDemo.OutputCache._Default" %>
<%@ OutputCache Duration="60" VaryByParam="P1" %>
<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
缓存的服务器时间：
<asp:Label ID="lblServerTime" runat="server" Text="Label"></asp:Label><br />
客户端时间：
<span id="clientTime"></span>
    </div>
    </form>
    

<script language="javascript" type="text/javascript">
    var nowTime = new Date();//获取当前时间
    document.getElementById("clientTime").innerHTML =
        nowTime.getFullYear() + "/" +                               //年
        (nowTime.getMonth() + 1) + "/" +                            //月
        nowTime.getDate() + " " +                                   //日
        nowTime.getHours().toString().substring(0,2) + ":" +        //时
        nowTime.getMinutes().toString().substring(0, 2) + ":" +     //分
        nowTime.getSeconds().toString().substring(0, 2);            //秒
</script>
</body>
</html>
