In diesem Artikel wird beschrieben, wie JS die aktuelle Zeit einfach erhalten und anzeigen kann. Teilen Sie es für Ihre Referenz wie folgt weiter:
<! DocType html> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type" content = "text/html; charset = gb2312"/> <title> current times> </hadern> </hadern> <- Date (); var Jahr = nun.GetFoyear (); // Jahr var monat = now.getMonth () + 1; // Monat var day = now.getDate (); // Tag var hh = now.gethours (); // Zeit var mm = now.getminutes (); // 平 var clock = Jahr +"-"; if (Monat <10) Uhr += "0"; Takt += Monat +"-"; if (Tag <10) Uhr += "0"; Takt += Tag +""; if (hh <10) Uhr += "0"; Takt += HH +":"; mm; document.write (Uhr); </script> </body> </html>
PS: Freunde, die an JavaScript -Zeit- und Datumsangeboten interessiert sind, können sich auch auf die Online -Tools dieser Website beziehen:
Unix Timestamp Conversion Tool:
http://tools.vevb.com/code/unixtime
Online -Zeitanfrage auf der ganzen Welt:
http://tools.vevb.com/zhuanhuanqi/worldtime
Online -Perpetual -Kalender:
http://tools.vevb.com/bianmin/wannianli
Web -Perpetual -Kalender:
http://tools.vevb.com/bianmin/webwannianli
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", "Zusammenfassung des JavaScript -Traversalalgorithmus und der Fähigkeiten" und "Zusammenfassung der Verwendung von JavaScript Mathematical Operation Nutzung"
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.