<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function TimeToShow() { var dt = new Date(); var la = document.getElementById("<%= Timer.ClientID %>"); la.innerHTML = dt.toLocaleTimeString(); window.setTimeout(TimeToShow, 1000); } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:label id="Timer" runat="server" text="Timer" xmlns:asp="#unknown"></asp:label> <asp:button id="btnStart" runat="server" text="Start" xmlns:asp="#unknown" /> </div> </form> </body> </html>
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="text1" runat="server"></asp:TextBox> </div> </form> </body> <script type="text/javascript"> function timedCount() { var dt = new Date(); //alert(dt.toLocaleTimeString()); document.getElementById("text1").value = dt.toLocaleTimeString(); window.setTimeout(timedCount,1000); } timedCount(); </script> </html>
SELECT convert(varchar(10), Getdate(), 108)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)