Very powerful JavaScript implementation pointer time _ time date

Source: Internet
Author: User
Tags cos sin
<ptml xmlns:v= "URN:SCHEMAS-MICROSOFT-COM:VML" > <script defer> Function Clock () {var nowtime=new Date () Nowhour=nowtime.gethours () if (nowhour>=12) nowhour-=12 nowminute=nowtime.getminutes () Nowsecond=nowtime.getSeco NDS () Nowmill=nowtime.getmilliseconds () var harc,marc,sarc,mmarc harc= (Nowhour+nowminute/60+nowsecond/3600+nowmill /3600000) *30 marc= (nowminute+nowsecond/60+nowmill/60000) *6 sarc= (nowsecond+nowmill/1000) *6//Angle string nh= (180-HARC) * math.pi/180 Harct=math.sin (NH) *250+500 Harcl=math.cos (NH) *250+500 harcstr=harct+ "," +HARCL Document.all.hourline.to.value=harcstr//minute string nm= (180-marc) *math.pi/180 marct=math.sin (nm) *350+500 marcL= Math.Cos (nm) *350+500 marcstr=marct+ "," +marcl document.all.minuteline.to.value=marcstr/sec string sm= (180-SARC) * math.pi/180 sarct=math.sin (SM) *400+500 Sarcl=math.cos (SM) *400+500 sarcstr=sarct+ "," +SARCL Document.all.secondline.to.value=sarcstr document.all.txt.innerhtml= "Now Time is:" +nowtime.gethours () + ":" +nowtime.geTminutes () + ":" +nowtime.getseconds () settimeout ("clock ()", "M")} </script> <STYLE> v\:* {behavior:url (# DEFAULT#VML)} </STYLE> <body onload= "clock ()" ><v:group id= "Clock" coordsize= "1000,1000" > <v:ova L id= "outercircle" fillcolor= "Gray"/> <v:oval id= "innercircle" fillcolor= "white"/> <v:line id= "Hourline" From= "500,500" to= "800,800" strokecolor= "Gray" > <v:stroke startarrow= "oval" endarrow= "classic" dashstyle= "Dot" strokecolor= "Red"/> </v:line> <v:line id= "Minuteline" from= "500,500" to= "500,900" strokecolor= "BLACK" > <v:stroke endarrow= "classic" dashstyle= "Dot"/> </v:line> <v:line id= "Secondline" from= "500,500" t o= "400,900" strokecolor= "Black" > <v:stroke endarrow= "classic" dashstyle= "Dot"/> </v:line> <span ;12</span> <span >3</span> <span >6</span> <span >9</span> <v:/group> <div Id=txt ></div> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Related Article

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.