You could try this JS:
function getTheDate()
{
var now = new Date()
date =
["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
[now.getDay()] + ", "
+ ["January","February","March","April","May","June","July",
"August","September","October","November","December"]
[now.getMonth()] + " "
+ now.getDate() + " "
+ now.getFullYear()
return date
}
//------------------------------
function getTheTime()
{
function paddigits(number,digits)
{ var limit = (digits == 2) ? 10
: (digits == 4) ? 1000
: 1
return (number < limit) ? "0" + number : number }
//------------------------------
var now = new Date()
var hours = now.getHours()
var dn = (hours >= 12) ? "PM" : "AM"
hours = (hours == 0) ? 12
: (hours > 12) ? (hours - 12)
: hours
var minutes = paddigits(now.getMinutes(),'2')
var seconds = paddigits(now.getSeconds(),'2')
var time = hours + ":" + minutes + ":" + seconds + " " + dn
return time
}
//------------------------------
function DateTime()
{
var cdate = '<b>'
+ getTheDate() + " "
+ getTheTime() + "</b>"
if (browser.ie4 || browser.ie5)
{document.all.clock.innerHTML = cdate}
else
if (document.getElementById) // dom
document.getElementById("clock").innerHTML = cdate
else
document.write(cdate)
}
//------------------------------
function gettime()
{ setInterval("DateTime()",1000) }
//------------------------------
Place the above code, as is, in a text file e.g. external.js
Place this in the head section of your HTML:
<script type="text/javascript" src="scripts/external.js"></script>
Alter the body tag to:
<body onload = "gettime()">
In the place where you want the date and time place this:
Current Date: <span id="clock"></span>
This creates a time ticker, i.e. updated every second. The time will be on
bold like this
Current Date: Friday, March 25 2005 3:00:45 PM
--
Cheers,
Trevor L.
Website:
http://tandcl.homemail.com.au
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html