Write Current Time

[Total: 0    Average: 0/5]

This shows the current date as the page loads.

Body Code:

<SCRIPT LANGUAGE="JavaScript">


<!-- Begin
Stamp = new Date();
document.write('<font size="3"><B>' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '</B></font><BR>');
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M.";
}
else {
Time = " A.M.";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}	
document.write('<font size="3"><B>' + Hours + ":" + Mins + Time + '</B></font>');
// End -->
</SCRIPT>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *