مجموعه کدهای گذاشتن ساعت و تاریخ در وبلاگ یا وب سایت 3 1 2 3 4 5 نورالدین بازدید : 5773 یکشنبه 22 فروردین 1389 نظرات (2) ساعتهای بعضی از شهرهای خارجی <table border="0" width="200" cellspacing="0" cellpadding="3"> <form name="where"> <tr> <td width="100%"> <select name="city" size="1" onchange="updateclock(this);"> <option value="" selected>Local 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="12">Fiji</option> <option value="-10">Hawaii</option> <option value="-8">San Francisco</option> <option value="-5">New York</option> <option value="-3">Buenos Aires</option> </select> </td> </tr> <tr> <td width="100%"> <script language="JavaScript"> /* Drop Down World Clock- By Learn iran (http://www.learniran.com) Portions of code by Kurt @ http://www.learniran.com/ This credit notice must stay intact */ if (document.all||document.getElementById) document.write('<span id="worldclock" style="font:bold 16px Arial;"></span><br>') 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> <!--Place holder for NS4 only--> <ilayer id="worldclockns" width=100% height=35><layer id="worldclockns2" width=100% height=35 left=0 top=0 style="font:bold 16px Arial;"></layer></ilayer> <p> </td> </form> </tr> </table> ساعتهای بیشتر شهرهای جهان <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Emanuel Gavrilv (eltal@sprint.ca) --> <!-- Web Site: http://www.angelfire.com/on/eltal --> <!-- Begin function GetTime() { var dt = new Date(); var def = dt.getTimezoneOffset()/60; var gmt = (dt.getHours() + def); document.clock.local.value = (IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds())); var ending = ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds()); var rome =check24(((gmt + 1) > 24) ? ((gmt + 1) - 24) : (gmt + 1)); document.clock.rome.value = (IfZero(rome) + ending); var isr =check24(((gmt + 2) > 24) ? ((gmt + 2) - 24) : (gmt + 2)); document.clock.Israel.value = (IfZero(isr) + ending); var msw =check24(((gmt + 3) > 24) ? ((gmt + 3) - 24) : (gmt + 3)); document.clock.msw.value = (IfZero(msw) + ending); var baku =check24(((gmt + 4) > 24) ? ((gmt + 4) - 24) : (gmt + 4)); document.clock.baku.value = (IfZero(baku) + ending); var del =check24(((gmt + 5) > 24) ? ((gmt + 5) - 24) : (gmt + 5)); document.clock.del.value = (IfZero(del) + ending); var dh =check24(((gmt + 6) > 24) ? ((gmt + 6) - 24) : (gmt + 6)); document.clock.dh.value = (IfZero(dh) + ending); var kok =check24(((gmt +7 ) > 24) ? ((gmt +7 ) - 24) : (gmt + 7)); document.clock.kok.value = (IfZero(kok) + ending); var ho =check24(((gmt + 8) > 24) ? ((gmt + 8) - 24) : (gmt + 8)); document.clock.ho.value = (IfZero(ho) + ending); var tky =check24(((gmt + 9) > 24) ? ((gmt + 9) - 24) : (gmt + 9)); document.clock.tky.value = (IfZero(tky) + ending); var sdn =check24(((gmt + 10) > 24) ? ((gmt + 10) - 24) : (gmt + 10)); document.clock.sdn.value = (IfZero(sdn) + ending); var mag =check24(((gmt + 11) > 24) ? ((gmt + 11) - 24) : (gmt + 11)); document.clock.mag.value = (IfZero(mag) + ending); var wll =check24(((gmt + 12) > 24) ? ((gmt + 12) - 24) : (gmt + 12)); document.clock.wll.value = (IfZero(wll) + ending); var _GMT =check24(((gmt) > 24) ? ((gmt) - 24) : (gmt)); document.clock._GMT.value = (IfZero(_GMT) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds())); var eniw =check24(((gmt + (24-12)) > 24) ? ((gmt + (24-12)) - 24) : (gmt + (24-12))); document.clock.eniw.value = (IfZero(eniw) + ending); var sam =check24(((gmt + (24-11)) > 24) ? ((gmt + (24-11)) - 24) : (gmt + (24-11))); document.clock.sam.value = (IfZero(sam) + ending); var haw =check24(((gmt + (24-10)) > 24) ? ((gmt + (24-10)) - 24) : (gmt + (24-10))); document.clock.Hawaii.value = (IfZero(haw) + ending); var ala =check24(((gmt + (24-9)) > 24) ? ((gmt + (24-9)) - 24) : (gmt + (24-9))); document.clock.alaska.value = (IfZero(ala) + ending); var pacif =check24(((gmt + (24-8)) >= 24) ? ((gmt + (24-8)) - 24) : (gmt + (24-8))); document.clock.pacif.value = (IfZero(pacif) + ending); var mount =check24(((gmt + (24-7)) > 24) ? ((gmt + (24-7)) - 24) : (gmt + (24-7))); document.clock.mount.value = (IfZero(mount) + ending); var center =check24(((gmt + (24-6)) > 24) ? ((gmt + (24-6)) - 24) : (gmt + (24-6))); document.clock.center.value = (IfZero(center) + ending); var east =check24(((gmt + (24-5)) > 24) ? ((gmt + (24-5)) - 24) : (gmt + (24-5))); document.clock.east.value = (IfZero(east) + ending); var atl =check24(((gmt + (24-4)) > 24) ? ((gmt + (24-4)) - 24) : (gmt + (24-4))); document.clock.atl.value = (IfZero(atl) + ending); var bra =check24(((gmt + (24-3)) > 24) ? ((gmt + (24-3)) - 24) : (gmt + (24-3))); bra = (bra >= 24) ? bra - 24 : bra; document.clock.bra.value = (IfZero(bra) + ending); var mid =check24(((gmt + (24-2)) > 24) ? ((gmt + (24-2)) - 24) : (gmt + (24-2))); mid = (mid >= 24) ? mid - 24 : mid; document.clock.mid.value = (IfZero(mid) + ending); var azo =check24(((gmt + (24-1)) > 24) ? ((gmt + (24-1)) - 24) : (gmt + (24-1))); azo = (azo >= 24) ? azo - 24 : azo; document.clock.azo.value = (IfZero(azo) + ending); setTimeout("GetTime()", 1000); } function IfZero(num) { return ((num <= 9) ? ("0" + num) : num); } function check24(hour) { return (hour >= 24) ? hour - 24 : hour; } // End --> </script> </HEAD> <!-- CONTINUE --> <BODY onLoad="javascript:GetTime();"> <!-- CONTINUE --> <center> <form name="clock"> <strong>Local Time <input type="text" size="8" name="local"></strong> <p> Eniwetok (GMT-12) <input type="text" size="8" name="eniw"><br> Samoa (GMT-11) <input type="text" size="8" name="sam"><br> Hawaii (GMT-10) <input type="text" size="8" name="Hawaii"> <p> Alaska (GMT-9) <input type="text" size="8" name="alaska"><br> Pacific Time (GMT-8) <input type="text" size="8" name="pacif"><br> Mountain Time (GMT-7) <input type="text" size="8" name="mount"> <p> Central Time (GMT-6) <input type="text" size="8" name="center"><br> Eastern Time (GMT-5) <input type="text" size="8" name="east"><br> Atlantic Time (GMT-4) <input type="text" size="8" name="atl"> <p> Brazilia (GMT-3) <input type="text" size="8" name="bra"><br> Mid-Atlantic (GMT-2) <input type="text" size="8" name="mid"><br> Azores (GMT-1) <input type="text" size="8" name="azo"> <p> <strong>Greenwich Mean Time (GMT) <input type="text" size="8" name="_GMT"></strong> <p> Rome (GMT +1) <input type="text" size="8" name="rome"><br> Israel (GMT +2) <input type="text" size="8" name="Israel"><br> Moscow (GMT +3) <input type="text" size="8" name="msw"> <p> Baku (GMT +4) <input type="text" size="8" name="baku"><br> New Delhi (GMT +5) <input type="text" size="8" name="del"><br> Dhakar (GMT +6) <input type="text" size="8" name="dh"> <p> Bangkok (GMT +7) <input type="text" size="8" name="kok"><br> Hong Kong (GMT +8) <input type="text" size="8" name="ho"><br> Tokyo (GMT +9) <input type="text" size="8" name="tky"> <p> Sydney (GMT +10) <input type="text" size="8" name="sdn"><br> Magadan (GMT +11) <input type="text" size="8" name="mag"><br> Wellington (GMT +12) <input type="text" size="8" name="wll"> </form> </center> <p><center> <font face="arial, helvetica" SIZE="-2">Free JavaScripts provided<br> by <a href="http://javascriptsource.com">JavaScript Source Code 3000</a></font> </center><p> <!-- END Script Size: 5.96 KB --> یک تقویم جالب <!-- ONE STEP TO INSTALL MONTHLY: DAY HIGHLIGHTED: 1. Put the code into the BODY of your HTML document --> <!-- STEP ONE: Copy this code into the HEAD your HTML document --> <BODY> <CENTER> <SCRIPT LANGUAGE="JavaScript"> <!--Total Java Scripts 99 - Next Step Software--> <!-- Begin monthnames = new Array( "January", "Februrary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "Decemeber"); var linkcount=0; function addlink(month, day, href) { var entry = new Array(3); entry[0] = month; entry[1] = day; entry[2] = href; this[linkcount++] = entry; } Array.prototype.addlink = addlink; linkdays = new Array(); monthdays = new Array(12); monthdays[0]=31; monthdays[1]=28; monthdays[2]=31; monthdays[3]=30; monthdays[4]=31; monthdays[5]=30; monthdays[6]=31; monthdays[7]=31; monthdays[8]=30; monthdays[9]=31; monthdays[10]=30; monthdays[11]=31; todayDate=new Date(); thisday=todayDate.getDay(); thismonth=todayDate.getMonth(); thisdate=todayDate.getDate(); thisyear=todayDate.getYear(); thisyear = thisyear % 100; thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear)); if (((thisyear % 4 == 0) && !(thisyear % 100 == 0)) ||(thisyear % 400 == 0)) monthdays[1]++; startspaces=thisdate; while (startspaces > 7) startspaces-=7; startspaces = thisday - startspaces + 1; if (startspaces < 0) startspaces+=7; document.write("<table border=2 bgcolor=white "); document.write("bordercolor=black><font color=black>"); document.write("<tr><td colspan=7><center><strong>" + monthnames[thismonth] + " " + thisyear + "</strong></center></font></td></tr>"); document.write("<tr>"); document.write("<td align=center>Su</td>"); document.write("<td align=center>M</td>"); document.write("<td align=center>Tu</td>"); document.write("<td align=center>W</td>"); document.write("<td align=center>Th</td>"); document.write("<td align=center>F</td>"); document.write("<td align=center>Sa</td>"); document.write("</tr>"); document.write("<tr>"); for (s=0;s<startspaces;s++) { document.write("<td> </td>"); } count=1; while (count <= monthdays[thismonth]) { for (b = startspaces;b<7;b++) { linktrue=false; document.write("<td>"); for (c=0;c<linkdays.length;c++) { if (linkdays[c] != null) { if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) { document.write("<a href=\"" + linkdays[c][2] + "\">"); linktrue=true; } } } if (count==thisdate) { document.write("<font color='FF0000'><strong>"); } if (count <= monthdays[thismonth]) { document.write(count); } else { document.write(" "); } if (count==thisdate) { document.write("</strong></font>"); } if (linktrue) document.write("</a>"); document.write("</td>"); count++; } document.write("</tr>"); document.write("<tr>"); startspaces=0; } document.write("</table></p>"); // End --> </SCRIPT> </CENTER> <!-- Script Size: 2.98 KB --></body></html> (Title) یک ساعت دیجیتالی در نوار عنوان <HEAD> <SCRIPT LANGUAGE="JavaScript"> <!-- Original: Massimo Giari (motore@iol.it) --> <!-- Begin var clocktext, timeday; var pagetitle = document.title; function scroll() { today = new Date(); sec = today.getSeconds(); hr = today.getHours(); min = today.getMinutes(); // 12 Hour clock fix by Michael Mann (pres@manninc.com) if (hr < 12) { timeday = " AM"; } else { timeday = " PM"; } if (hr > 12) hr = hr - 12; if (hr <= 9) hr = "0" + hr; if (min <= 9) min = "0" + min; if (sec <= 9) sec = "0" + sec; var clocktext = " - " + hr + ":" + min + ":" + sec + timeday; clocktimer = setTimeout("scroll()", 1000); document.title = pagetitle + clocktext; } if (document.all) scroll(); // End --> </script> <!-- END Script Size: 0.90 KB -->
مطالب مرتبط مجموعه کد های جاوای ساعت و وقت (تاریخ و زمان) 2 مجموعه کد های جاوای ساعت و وقت (تاریخ و زمان)
ارسال نظر برای این مطلب این نظر توسط Ras0ul.M در تاریخ 1348/10/11 و 4:39 دقیقه ارسال شده است سلام.ممنون میشم همراه کد یه عکس هم برای اون نمونه کد بزارین با تشکر. این نظر توسط shahrooz در تاریخ 1348/10/11 و 11:08 دقیقه ارسال شده است وبلاگ خوبی داری به وبلاگ من هم سری بزن متن شما نام آدرس سایت ایمیل کد امنیتی ارسال نظر خصوصی فقط برای نویسنده ذخیره مشخصات