Mega Code Archive

 
Categories / ASP.Net / Page
 

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() %>