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"+" "+ Hour +":"+ min +":"+ sec +" "+ 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)