Hi! I think i've found a JavaScript that could be of help:
Code:
<script LANGUAGE="JavaScript">
<!--
today = new Date(); if(today.getMinutes() < 10) {pad = "0"} else pad = "";
if((today.getHours() < 12) && (today.getHours() >= 6)) {document.write("<IMG width='164' height='30' SRC='images/gm.gif'>")}
if((today.getHours() >= 12) && (today.getHours() < 18)) {document.write("<IMG width='164' height='30' SRC='images/ga.gif'>")}
if((today.getHours() >= 18) && (today.getHours() <= 23)) {document.write("<IMG width='164' height='30' SRC='images/ge.gif'>")}
if((today.getHours() >= 0) && (today.getHours() < 4)) {document.write("<IMG width='164' height='30' SRC='images/gme.gif'>")}
if((today.getHours() >= 4) && (today.getHours() <= 6)){document.write("<IMG width='164' height='30' SRC='images/gmve.gif'>")}
if((today.getDate() == 25) && (today.getMonth() == 11)) {document.write("<BR><FONT SIZE=5 FACE='Arial,Helvetica' COLOR=red><B><BLINK>Have a Happy Christmas Day</BLINK></B></FONT>")}
if((today.getDate() > 25) && (today.getDate() <= 31) && (today.getMonth() == 11)){document.write("<BR><FONT SIZE=5 FACE='Arial,Helvetica' COLOR=maroon><B><BLINK>Merry Christmas</BLINK></B></FONT>")}
if((today.getDate() >= 1) && (today.getDate() <= 8) && (today.getMonth() == 0)){document.write("<BR><FONT SIZE=5 FACE='Arial,Helvetica' COLOR=red><B><BLINK>A Prosperous & Happy 1998!</BLINK></B></FONT>")}
// -->
</script>
Each of these if statements checks the time and writes some HTML based on what time it is. You can use the HTML to disply an image, or some text depending on the time of day and / or day of year by building up these IF statements and changing them.
I use a simplified version myself to greet visitors with a good morning, good afternoon or good evening based on the time of day.
Hope that helps a bit.
Ady
Bookmarks