Click to See Complete Forum and Search --> : I Need Help Again!


neenach2002
10-31-2003, 02:25 PM
<script language="JavaScript">
<!--

// ***********************************************
// AUTHOR: Subtilty Wharf Graphics
// URL: http://www.subtiltywharf.dk3.com ***********************************************

function resetIt() {

// Calculate Time

var timerID = null;
var timerRunning = false;

if(timerRunning)
clearTimeout(timerID);
timerRunning = false;

// getTime
var timeNow = new Date();
var hours = timeNow.getHours();
var minutes = timeNow.getMinutes();
var seconds = timeNow.getSeconds();
var timeValue = "" + ((hours >12) ? hours -12 :hours)
timeValue = ((timeValue <10)? "0":"") + timeValue
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " PM" : " AM"
timerID = setTimeout("resetIt()",100);
timerRunning = true;


// getDate
var dateNow = new Date();
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var months = new Array('January','February','March','April','May','June','July','August','September','October','Novem ber','December');
var date = ((dateNow.getDate()<10) ? "0" : "")+ dateNow.getDate();
function y2k(number){return (number < 1000) ? number + 1900 : number;}

// compileIt
today = timeValue + " " + days[dateNow.getDay()] + " " +
months[dateNow.getMonth()] + ", " +
date + " " +
(y2k(dateNow.getYear()));

if(document.all || document.getElementById){ // Browser Check
document.title = today.toString();
}else{
self.status = today.toString(); // Default to status.
}
}

resetIt();

//-->
</script>

i want to make it so that this code will display in the page not in the title bar...how do i do this?

Charles
10-31-2003, 03:57 PM
<script type="text/javascript">
<!--
Date.prototype.toString = function () {return [this.toTimeString(), ['Sunday,', 'Monday,', 'Tuesday,', 'Wednesday,', 'Thursday,', 'Friday,', 'Saturday,'] [this.getDay()], this.getDate(), ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] [this.getMonth()], this.getFullYear()].join(' ')}

document.write('<p id="time">', new Date(), '</p>');
setInterval("document.getElementById('time').firstChild.data = new Date()", 50);
// -->
</script>

neenach2002
10-31-2003, 03:59 PM
much thanks Charles!