Contoh artikel ini menggambarkan bagaimana JS menampilkan waktu dunia. Bagikan untuk referensi Anda, sebagai berikut:
<! Doctype html public "-// w3c // dtd html 4.0 transitional // en"> <html> <head> <title> waktu dunia, js halaman web efek khusus </iteme> </head> <body bgcolor = "#ffffff" onload = "javascript: getTime ();"> <navfor = "JAVFFF" ONLOAD = "Javascript: gettime ();" var dt = tanggal baru (); var def = dt.getTimeZoneoffset ()/60; var gmt = (dt.getHours () + def); document.clock.local.value = (ifzero (dt.gethours ()) + ":" + ifzero (dt.getMinutes ())) (): " + ifzero (dt.getMinutes ())) ()) +": " = ":" + 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 = centang24 ((gmt + 3)> 24)? ((gmt + 3) - 24): (gmt + 3)> 24)? (GMT + 3): (GMT + 3)> 24); (Ifzero (msw) + ending); var baku = check24 (((gmt + 4)> 24)? ((GMT + 4) - 24): (GMT + 4)); Document.clock.baku.value = (ifzero (Baku) + akhir); var var del = check24 ((gmt + ( -gmzer) + 24)? 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)); var.clock. ((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. = 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)> 24)? (GMT + 9) - 24): (GMT + 9)> 24)? (Ifzero (tky) + ending); var sdn = check24 (((gmt + 10)> 24)? ((GMT + 10) - 24): (GMT + 10)); Document.Clock.sdn.Value = (ifzero (sdn) + akhir); var mag = check24 ((gmt + ( -sdn) +? 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)? ((GMT) - 24): (GMT)); document.clock._gmt.value = (ifzero (_gmt) + ":" + ifzero (dt.getMinutes ()) + ":" + ifzero (dt.getSeconds ())); var eniW = check24 (gm) (24) (24) (24) (24) (24) (24) (gm) (24) (gm) (gm) (gm) (gm) (gm)); (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 + (GMT) (24-11))-24): (GMT + (GMT) (24-11)-24): (GMT + (GMT) (24-11))-24): (GMT + (GMT) (24-11)-24): (GMT + (GMT) (24-11))-24): (GMT) (GMT))-24): 24): 24) (GMT))-24): (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 = hawaii. ((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): (24-8)> = 24)? (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.Count.Mount.Mount.mount.mount) (GMT + (24-7))); Document.Clock.Count.Mount.Mount.mount) (GMT + (24-7))); Document.Clock.Mount.Mount.Mount.mount = GMT = = check24 (((GMT + (24-6))> 24)? ((GMT + (24-7))); Document.clock.mount.value = (ifzero (mount) + ending); var center = check24 ((GMT + (24-6))> 24)? ((GMT + (24-6) (GMT + (24-6))> 24)? ; = 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))); var bRa = check24 ((gmt + (24-3))); var bRa = check24 ((GMT + (24-3))); (GMT + (24-3))); bra = (bra> = 24)? (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><form name="clock"><strong>Local Time <input type="text" size="8" name="local"></strong><p>Eniwitok Island (GMT-12) <input type="text" size="8" name="eniw"><br>Samoa Islands (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 = "name =" name = "name =" name = "Pacific (gmt-8) <input type" "name =" name = "8" name = "8" <"name =" 8 "name =" 8 " (GMT-7) <input type="text" size="8" name="mount"><p>Central Standard Time (GMT-6) <input type="text" size="8" name="center"><br>East 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> Waktu Mid-Atlantik (GMT-2) <Input Type = "Teks" Ukuran = "8" Name = "Mid"> <br> Kepulauan Asyrian (GMT-1) <input "name =" mid "> <br> pulau asyrian (gmt-1) <input" name = "mid"> <br> pulau asyrian (gmt-1) <input "name =" mid "> <br> pulau asyrian (gmt-1) <input" name = "mid"> <br> pulau asyrian (gmt-1) <input "name =" Mid " 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> Moskow (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 = "gesu" "name =" name = "8" name = "name =" name = "name =" name = "name =" name = "name =" name = "GMT =" GMT = "GMT =" 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> TOppe (GMT "input =" TEXT "=" 8 "NAME =" HO "> <br> TOppe (GMT (GM) <(TEXT" NAME = "8" NAME = "HO"> <br> TOPEK (GMT (GMT (GM (GM (GM (GM (GM) name = "tky"> <p> sydney (gmt +8) +10) <input type = "text" size = "8" name = "sdn"> <br> magadan (gmt +11) <input type = "text" size = "8" name = "mag"> <br> wellington (gmt +12) <input tipe = " name = "wll"> </form> </body> </html>Teman -teman yang tertarik dengan tampilan waktu dan tanggal JavaScript juga dapat merujuk pada alat online situs ini :
Pertanyaan waktu online di seluruh dunia
Kalender abadi online
Kalender Perpetual Web
For more information about JavaScript, please check this site's special topics: "Summary of JavaScript Time and Date Operation Skills", "Summary of JavaScript Switching Effects and Skills", "Summary of JavaScript Search Algorithm Skills", "Summary of JavaScript Animation Special Effects and Skills", "Summary of JavaScript Errors and Debugging Skills", "Summary of JavaScript Data Structures and Algorithm Skills", "Ringkasan Algoritma dan Keterampilan Traversal Javascript" dan "Ringkasan Penggunaan Operasi Matematika JavaScript"
Saya harap artikel ini akan membantu pemrograman JavaScript semua orang.