Re: Time display

by Tamara Abbey <tamara(at)abbeyink.com>

 Date:  Mon, 21 Aug 2000 11:25:46 -0500
 To:  MCrowtherUK(at)aol.com,
hwg-basics(at)hwg.org
 In-Reply-To:  aol
  todo: View Thread, Original
.var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;
myyear= mydate.getYear();
year = myyear;
myhours = mydate.getHours();
ampmhour  =  (myhours > 12) ? myhours - 12 : myhours;
ampm =  (myhours >= 12) ? ' PM' : ' AM';
mytime = mydate.getMinutes();
myminutes =  ((mytime < 10) ? ':0' : ':') + mytime;
if(myday == 0)
day = " Sunday, ";
else if(myday == 1)
day = " Monday, ";
else if(myday == 2)
day = " Tuesday, ";
else if(myday == 3)
day = " Wednesday, ";
else if(myday == 4)
day = " Thurday, ";
else if(myday == 5)
day = " Friday, ";
else if(myday == 6)
day = " Saturday, ";
if(mymonth == 0) {
month = "January ";}
else if(mymonth ==1)
month = "February ";
else if(mymonth ==2)
month = "March ";
else if(mymonth ==3)
month = "April ";
else if(mymonth ==4)
month = "May ";
else if(mymonth ==5)
month = "June ";
else if(mymonth ==6)
month = "July ";
else if(mymonth ==7)
month = "August ";
else if(mymonth ==8)
month = "September ";
else if(mymonth ==9)
month = "October ";
else if(mymonth ==10)
month = "November ";
else if(mymonth ==11)
month = "December ";

Is a script I *inherited* from a site,

This is the part to put in the body:

<.SCRIPT language="JavaScript">
document.write("<font color=#33ff33 face='helvetica,arial' size='small'>" + 
ampmhour + "" + myminutes + ampm)
document.write(" | " + day + month);
document.write(myweekday + ", " + year + "</p>");
</SCRIPT>

BUT, it displays the year 100 in NN 4.5.

HTH,
Tamara


At 10:52 AM 8/21/00 -0400, MCrowtherUK(at)aol.com wrote:
>Hi All,
>
>I need to display the time on my web page.
>Is this just JavaScript or can you do it in HTML?
>
>Can you get the time from the server as I think most peoples clocks are wrong
>on the PC? - I'm guessing this has got to be JavaScript again - or is their a
>href tag for the server?
>
>Thanks,
>
>Mark.

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA