Este artigo ilustra como o JS exibe o tempo do mundo. Compartilhe -o para sua referência, como segue:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE>World Time, JS Web Page Special Effects</TITLE></HEAD><body bgcolor="#ffffff" onLoad="javascript:GetTime();"><SCRIPT LANGUAGE="JavaScript"><!-- Beginfunction GetTime () {var dt = new Date (); var def = dt.getTimeZoneOffSet ()/60; var gmt = (dt.gethours () + def); document.clock.local.value = (ifZero (dt.gethours () + ":" + ifZero (dt.get.minute () (dt.gethours () + ":" + ifZero (dt.get.Minute () IfZero (dt.getSeconds ())); var ending = ":" + ifzero (dt.getminutes ()) + ":" + ifzero (dt.getSeconds ()); var roma = check24 (((gmt + 1)> 24)? ((Gmt + 1) - 24): (gm 1; (IfZero (Roma) + final); var isr = check24 (((GMT + 2)> 24)? ((GMT + 2) - 24): (gmt + 2)); document.clock.israel.value = (ifZero (isr) + ending); 3)); document.clock.msw.value = (ifzero (rsw) + final); var baku = check24 (((gmt + 4)> 24)? ((Gmt + 4) - 24): (gmt + 4); ((gmt + 5) - 24): (gmt + 5)); document.clock.del.value = (ifzero (del) + final); var dh = check24 (((gmt + 6)> 24)? = verificação24 (((gmt +7)> 24)? ((gmt +7) - 24): (gmt +7)); document.clock.kok.value = (ifZero (kok) + final); var ho = check24 (((gmt + 8)> 24)? (IfZero (HO) + final); var tky = check24 (((GMT + 8)> 24)? ((GMT + 8) - 24): (GMT + 8)); document.clock.ho.value = (ifZero (ho) + final); var 9)); document.clock.tky.value = (ifzero (tky) + final); var sdn = check24 (((gmt + 10)> 24)? ((Gmt + 10) - 24): (gmt + 10)); ((gmt + 11) - 24): (gmt + 11)); document.clock.mag.value = (ifzero (mag) + final); var wll = check24 (((gmt + 12)> 24)? ((gmt + 12) - 24): (gmt + 12); = check24 (((gmt)> 24)? ((gmt) - 24): (gmt)); document.clock._gmt.value = (ifzero (_gmt) + ":" + ifZERO (dt.getminutes ()) + ":" ENZERO (DT.GET. (Dt.) > 24)? (24-11)); = verificação24 (((gmt + (24-9))> 24)? ((GMT + (24-9))-24): (GMT + (24-9))); (gmt + (24-8))); document.clock.pacif.value = (ifzero (PACIF) + final); var mount = check24 (((gmt + (24-7))> 24)? ((gmt + (24-7))-24): (gmt + (24-7)); = verificação24 (((GMT + (24-6))> 24)? ((GMT + (24-7))); document.clock.mount.value = (ifzero (Mount) + final); var Center = Check24 (((GMT + (24-6))> 24)? (24-6)); + (24-4))> 24)? (24-3)); BRA = (BRA> = 24)? > = 24)? MID-24: MID; document.clock.mid.value = (ifzero (MID) + final); 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) + final); setTimeout ("gettime ()", 1000);} função ifZero (num) {return ((num <= 9)? ("0" + num): num);} função 24 (hora) {Return (hora> 24) hora-24: hora;} // end-> </sCript> <name de forma = "relógio"> <strong> horário local <input type = "text" size = "8" name = "local"> </strong> <p> eniwitok ilha (gmt-12) <input type = "text =" 8 "name =" eniw "> <br-samon) <but type =" text = "8" name = "eniw"> <br-samon) size = "8" name = "sam"> <br> Havaí (gmt-10) <input type = "text" size = "8" name = "havai"> <p> alaska (gmt-9) <input type = "text" size = "8" name = "alaska"> <br> time (gmt-8) <bmt "<sput" typen) (Gmt-7) <input type = "text" size = "8" name = "montagem"> <p> Tempo padrão central (gmt-6) <input type = "text" size = "8" name = "center"> <br> tempo leste (gmt-5) <input type = "text =" size "8" name = "leste"> <br> atlatint) (time "size =" size "4) name = "atl"> <p> Brasilia (gmt-3) <input type = "text" size = "8" name = "Bra"> <br> Tempo de média da atlantar (gmt-2) <input type = "text" size = "8" name = "mid"> <br> asyrian ilhas (gmt-1) <input = type = "text =" mid "> <br> asyrian (gmt-1) <input = typen" (Gmt) <input type = "text" size = "8" name = "_ gmt"> </strong> <p> roma (gmt +1) <input type = "text" size = "8" name = "rome"> <br> israel (gmt +2) <input = "text" times = "8" namesra "" "[3 gmt +2) <input =" text "tamanho =" 8 "8" (namesra> "rael" é "[gmt +2) <input =" text "size =" 8 "8" "=" "[3 gmt +2) <input type =" text "size =" "8" namesra "" "". type = "text" size = "8" name = "msw"> <p> baku (gmt +4) <type de entrada = "text" size = "8" name = "baku"> <br> novo delhi (gmt +5) <input type = "text" size = "8" name = "del"> <br> dhakar (gm6) 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 +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 type = "text" = "8" name = "wll"> "> </forma </forma </forma <form> <form> (gmt +12) <input type =" text "=" 8 "name =" wll ">Amigos interessados na exibição de tempo e datas de JavaScript também podem se referir às ferramentas on -line deste site :
Inquérito de tempo online em todo o mundo
Calendário perpétuo online
Calendário perpétuo da 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", "Resumo do Algoritmo e Habilidades de Traversal JavaScript" e "Resumo do Uso da Operação Matemática JavaScript"
Espero que este artigo seja útil para a programação JavaScript de todos.