theonesage
02-20-2009, 06:05 PM
I am trying to link the variable (m) to the getMonth() function below it, or replace it whatever I need to do. I want the month to be displayed in words instead of numbers. Thanks if you can help.
<script language="javascript">
Date.prototype.getMonthName = function()
{
var m = ['January','February','March','April','May','June','July',
'August','September','October','November','December'];
return m[this.getMonth()];
}
var clockID = 0;
function UpdateClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
var tDate = new Date();
document.theClock.theTime.value = ""
+ tDate.getMonth() + " "
+ tDate.getDay() + ", "
+ tDate.getYear() + " "
+ tDate.getHours() + ":"
+ tDate.getMinutes() + ":"
+ tDate.getSeconds();
clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
clockID = setTimeout("UpdateClock()", 500);
}
function KillClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
}
</script>
<form name="theClock" class="myform">
<input type="text" name="theTime" size="25" />
</form>
<script language="javascript">
Date.prototype.getMonthName = function()
{
var m = ['January','February','March','April','May','June','July',
'August','September','October','November','December'];
return m[this.getMonth()];
}
var clockID = 0;
function UpdateClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
var tDate = new Date();
document.theClock.theTime.value = ""
+ tDate.getMonth() + " "
+ tDate.getDay() + ", "
+ tDate.getYear() + " "
+ tDate.getHours() + ":"
+ tDate.getMinutes() + ":"
+ tDate.getSeconds();
clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
clockID = setTimeout("UpdateClock()", 500);
}
function KillClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
}
</script>
<form name="theClock" class="myform">
<input type="text" name="theTime" size="25" />
</form>