Add IQuery dynamic display time for the blog Park (or website) (in the format: Day of the month and days of the week)

Source: Internet
Author: User

1. Display style

The time is displayed dynamically.

2. How to add

Insert the following code where you need it:

<!--time call--><div style="Background:pink;text-align:center;"Id="Timer"></div><script type="Text/javascript">$ (function () {setinterval ("GetTime ()", +);        }); function GetTime () {varMon, day, now, Hour, Min, ampm, time, str, TZ, end, beg, sec; /*Mon = new Array ("Jan", "Feb", "Mar", "APR", "may", "June", "Jul", "April", "Sep", "Oct", "Nov"          , "Dec"); */Mon=NewArray ("January","February","March","April","May","June","July","August",                  "September","October","November","December"); /*Day = new Array ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); */ Day=NewArray ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); now=NewDate (); Hour=now.gethours (); Min=now.getminutes (); SEC=now.getseconds (); if(Hour <Ten) {Hour="0"+hour; }          if(Min <Ten) {min="0"+min; }          if(Sec <Ten) {sec="0"+sec; }          $("#Timer"). HTML ("<nobr>"+ now.getfullyear () +"years"+ Mon[now.getmonth ()] + now.getdate () +"Day"+"&nbsp;&nbsp;"+ Hour +":"+ min +":"+ sec +"&nbsp;&nbsp;"+ Day[now.getday ()] +"</nobr>"); }  </script>

The display format of the time itself can be adjusted.

Add IQuery dynamic display time for the blog Park (or website) (in the format: Day of the month and days of the week)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.