Get server time (C#) : OutputCache « Page « ASP.Net






Get server time (C#)

<%@ OutputCache Duration="60" VaryByParam="none" %>

<script  language="c#" runat = "server">
  string ServerTime()
  {
    return System.DateTime.Now.ToLongTimeString();
  }
</script>

The time on your web server is : <%=ServerTime() %>

           
       








Related examples in the same category

1.Using the OutputCache Directive (VB.net)
2.Cache duration (C#)
3.Asp cache by browser