This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14608|Reply: 0

[Jquery] Jquery gets the current system date and time

[Copy link]
Posted on 6/6/2015 12:36:17 PM | | |
  1. <%@ Page Title="主页" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
  2.     CodeBehind="Default.aspx.cs" Inherits="ZhangRuYi._Default" %>

  3. <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
  4. <scrip去掉t src="scrip去掉ts/jquery-1.4.1.js" type="text/javascrip去掉t"></scrip去掉t>
  5. <scrip去掉t type="text/javascrip去掉t">   
  6.         function currentTime() {
  7.         var d = new Date(), str = '';
  8.         str += d.getFullYear() + '年';
  9.         str += d.getMonth() + 1 + '月';
  10.         str += d.getDate() + '日';
  11.         str += d.getHours() + '时';
  12.         str += d.getMinutes() + '分';
  13.         str += d.getSeconds() + '秒';
  14.         return str;
  15.     }
  16.     setInterval(function () { $('#time').html(currentTime) }, 1000);
  17. </scrip去掉t>

  18. </asp:Content>
  19. <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
  20.     当前时间:<div id="time"></div>
  21. </asp:Content>
Copy code






Previous:Shenzhen Liantianxia Technology Co., Ltd
Next:Baidu Japan search engine was closed and was discovered a month later
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com