»
EnglishFrenchVietnamese

Print - Current Date- Time script - JavaScriptBank.com

Full version: jsB@nk » Time » Clock » Current Date- Time script
URL: https://www.javascriptbank.com/current-date-time-script.html

Current Date- Time script © JavaScriptBank.comAnother script to display current date and time on your web pages.

Full version: jsB@nk » Time » Clock » Current Date- Time script
URL: https://www.javascriptbank.com/current-date-time-script.html



JavaScript
<script Language="JavaScript">function gettheDate() {Todays = new Date();TheDate = "" + Todays.getDate() +" / "+ (Todays.getMonth() + 1) + " / " + Todays.getYear() document.clock.date.value = TheDate;}var timerID = null;var timerRunning = false;function stopclock (){if(timerRunning)clearTimeout(timerID);timerRunning = false;}function startclock2 () {stopclock();gettheDate()showtime();}function showtime () {var now = new Date();var hours = now.getHours();var minutes = now.getMinutes();var seconds = now.getSeconds()var timeValue = "" + ((hours >12) ? hours -12 :hours)timeValue += ((minutes < 10) ? ":0" : ":") + minutestimeValue += ((seconds < 10) ? ":0" : ":") + secondstimeValue += (hours >= 12) ? " P.M." : " A.M."document.clock.face.value = timeValue;timerID = setTimeout("showtime()",1000);timerRunning = true;}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form name="clock" onSubmit="0"><input type="text" name="date" size="12" value="" style="font-family: Arial; font-size: 8pt; color: #C0C0C0; font-weight: bold; text-align: center; border: 1px solid #6B0000; background-color: #290000"><input type="text" name="face" size="12" value="" style="font-family: Arial; font-size: 8pt; color: #C0C0C0; font-weight: bold; text-align: center; border: 1px solid #6B0000; background-color: #290000"></form><SCRIPT LANGUAGE="JavaScript"><!--startclock2()//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->