This article is an improvement on the "JavaScript"-a dynamic time in local time (click to open link)
In addition to being able to directly tolocalestring (), the date type in JavaScript translates into a system-formatted time
Time can also be customized format, such as can be constructed in an imitation QQ chat box synchronization in the local time of the dynamic clock
The specific code is as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">Thought and "JavaScript" a synchronization in the local time of the article (click Open link) exactly the same, the key is the SetInterval function, at the same time, the reason is to add a variety of less than 10 of the conditional structure, because, if not added, such as 19:01:01 will become 19 : 1:1 does not conform to our habits."JavaScript" a dynamic clock synchronized to local time and custom time format