Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date On Website - Frontpage 2000

Status
Not open for further replies.

Kathie1101

Technical User
Apr 19, 2002
11
GB
Hi

I am using Frontpage 2000 to create a website - I want to be able to show the current date and maybe the time on my website (not the date it was last updated). I am a relative beginner at website building (thats why I'm using Frontpage) - is it possible for me to easily do this?

Any help appreciated.

Kathie
 
Step 1: Insert the below anywhere into the <body> section of your page where you wish the clock to be displayed

<script>
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function goforit(){
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

</script>
<span id="clock"></span>

Step 2: Add the below into the <body> tag itself, like this:
<body onLoad="goforit()">

Configuring the date- You can change the font type, size, and color of the date. To do so, go to the line "//change font configuration here" in the above code. Right below that line contains the simple HTML tags that you should change to change the font.




Aaron Taylor
John Mutch Electronics
 
Thank you for your help, very much appreciated. I had managed to find some code just before I saw your post - so I am now sorted.

Thanks again

Kathie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top