|
| 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | |
|
|
|
|
|
|
|
Code _Clock (Time Zone)
<TABLE style=" border= 2px dashed #FFFFFF;" cellSpacing=0 cellpadding=10> <TR>< TD> <form name="where"> <select name="city" size="1" onchange="updateclock(this);"> <option value="" selected>Your PC Time</option> <option value="0">London GMT< /option> <option value="1">Rome</option> <option value="7">Bangkok</option> <option value="8">Hong Kong</option> <option value="9">Tokyo</option> <option value="10">Sydney</option> <option value="-10">Hawaii</option> <option value="-8">San Francisco</option> <option value="-5">New York</option> </select>< br> <script language="JavaScript"> if (document.all||document.getElementById) document.write('<center><span id="worldclock" style="font:bold 12px Tahoma;"></span><br></center>') zone=0; isitlocal=true; ampm=''; function updateclock(z){ zone=z.options[z.selectedIndex].value; isitlocal=(z.options[0].selected)?true:false; } function WorldClock(){ now=new Date(); ofst=now.getTimezoneOffset()/60; secs=now.getSeconds(); sec=-1.57+Math.PI*secs/30; mins=now.getMinutes(); min=-1.57+Math.PI*mins/30; hr=(isitlocal)?now.getHours():(now.getHours() + parseInt(ofst)) + parseInt(zone); hrs=-1.575+Math.PI*hr/6+Math.PI*parseInt(now.getMinutes())/360; if (hr < 0) hr+=24; if (hr > 23) hr-=24; ampm = (hr > 11)?"PM":"AM"; statusampm = ampm.toLowerCase(); hr2 = hr; if (hr2 == 0) hr2=12; (hr2 < 13)?hr2:hr2 %= 12; if (hr2<10) hr2="0"+hr2 var finaltime=hr2+':'+((mins < 10)?"0"+mins:mins)+':'+((secs < 10)?"0"+secs:secs)+' '+statusampm; if (document.all) worldclock.innerHTML=finaltime else if (document.getElementById) document.getElementById("worldclock").innerHTML=finaltime else if (document.layers){ document.worldclockns.document.worldclockns2.document.write(finaltime) document.worldclockns.document.worldclockns2.document.close() } setTimeout('WorldClock()',1000); } window.onload=WorldClock //--> </script></TD></TR></TABLE>
Note:: สามารถเพิ่ม หรือ ลบ Time Zone ได้ เช่น London Timezone = 0 <option value="0">London GMT< /option>
Create Date : 19 กุมภาพันธ์ 2550 |
|
5 comments |
Last Update : 19 กุมภาพันธ์ 2550 1:32:24 น. |
Counter : 762 Pageviews. |
|
|
|
|
| |
โดย: panad 19 กุมภาพันธ์ 2550 1:36:06 น. |
|
|
|
| |
โดย: panad 19 กุมภาพันธ์ 2550 1:39:32 น. |
|
|
|
| |
โดย: Malee30 19 กุมภาพันธ์ 2550 2:34:06 น. |
|
|
|
| |
โดย: WingClub 23 กุมภาพันธ์ 2550 23:18:55 น. |
|
|
|
| |
โดย: somsak tappathamrong IP: 118.172.140.239 21 ตุลาคม 2553 11:20:16 น. |
|
|
|
|
|
|
|
ขอบคุณ..คุณ hayashimali สำหรับเวบ Link ดี ดีค่ะ