Monday, 28 October 2013

JQuery:How to Display Current Date and Time on Webpage using ASP.NET

Hi friends,in this article i will explain about How to Display Current Date and Time on Webpage using ASP.NET using JQuery.
In ASP.NET design page write the following code.
<html xmlns="">
<head runat="server">
    <title>jQuery Display Current Time on Webpage using</title>
<script src="" language ="javascript" type ="text/javascript" >
   <script type="text/javascript">
       $(document).ready(function () {
       function ShowDateAndTime() {
           var dt = new Date();
          $("#lblTime").html(dt.toLocaleDateString() + "  " + dt.toLocaleTimeString());
           window.setTimeout("ShowDateAndTime()", 1000); // Here 1000(milliseconds) means  1 Second
    <form id="form1" runat="server">
    <div>The Current Date and Time is
    <asp:Label ID="lblTime" runat="server" style="Color:Green;"></asp:Label>  

   The output of the above code as shown in the below figure..Actually it showning current time with seconds.Check it once.
"If you like my blog or articles, you can appreciate by leaving your comments or Liking my Facebook pageAspdotnet-kishore, following on Google+ Aspdotnet-Kishore, Twitter  on AspdotnetKishore, Linked in Aspdotnet-Kishore, stumbling my posts on stumble upon and subscribing on  RSSfeed Aspdotnet-Kishore for free updates directly to your Email inbox . Watch my blog  for more articles."

No comments:

Post a Comment

© 2012-2018 All Rights Reserved.
The content is copyrighted to Kishore and may not be reproduced on other websites without permission from the owner.