$ ("Body"). Append ("<div id= ' addmytime ' style= ' font-size:25px; padding:5px; Background-color: #ccc; Color: #fff; position:fixed; top:100px; left:20px; ' > "+gettime () +" </div> ");functionGetTime () {varnow =NewDate (); varHH =now.gethours (); varMi =now.getminutes (); varSS =now.getseconds (); if(HH >= 0 && hh <= 9) {hh = "0" +hh;} if(Mi >= 0 && mi <= 9) {mi = "0" +mi;} if(SS >= 0 && SS <= 9) {ss = "0" +SS;} returnhh+ ":" +mi+ ":" +SS;}vartt = SetInterval (function(){ $("#addMyTime"). Text (GetTime ());},450);
has been synchronized with the time.windows.com, the local time with Baidu a few seconds, do not know how to return?
Greasemonkey, referred to as GM, the Chinese commonly known as "oil Monkey", is a Mozilla Firefox add-ons.
It allows users to install a number of scripts to make most HTML-based Web pages directly on the user side to change more easily.
Greasemonkey can add new features to Web pages, fix Web page errors, combine data from different Web pages, or count on other features that are not available for download.
A good Greasemonkey script even allows its output to be seamlessly integrated with the page being modified, as part of the original Web page.
If you want to add date, refer to:
functiongetnowformatdate () {varDate =NewDate (); varSeperator1 = "-"; varSeperator2 = ":"; varmonth = Date.getmonth () + 1; varStrdate =date.getdate (); if(Month >= 1 && month <= 9) {Month= "0" +month; } if(strdate >= 0 && strdate <= 9) {strdate= "0" +strdate; } varcurrentdate = date.getfullyear () + seperator1 + month + Seperator1 +strdate+ "" + date.gethours () + Seperator2 +date.getminutes ()+ Seperator2 +date.getseconds (); returncurrentdate;}
Firefox-use Greasemonkey to show local time to the page