Re: Date Script that refreshes itself

by "Peter Newton" <c-newton(at)ihug.co.nz>

 Date:  Fri, 21 Jan 2000 16:32:17 +1300
 To:  <hwg-techniques(at)hwg.org>
 References:  cp
  todo: View Thread, Original
Hello Sam

Here is a bit of code I use to display a running clock.

It uses a form text field and the clock is synchronised to your pc clock.



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">

<html>
<head><title>Clock</title>

<SCRIPT LANGUAGE="JavaScript">
<!--

function showtime() {
 var time = new Date();

 day = time.getDay();
 year = time.getYear();
 month = time.getMonth();
 date = time.getDate();
 hrs = time.getHours();
 mins = time.getMinutes();
 secs = time.getSeconds();

 if (mins < 10) mins = "0"+mins;
 if (hrs < 10) hrs = "0"+hrs;

 time=date+"/"+(month+1)+"/"+year+"  "+hrs+":"+mins;
 document.clock.display.value = time;

 setTimeout("showtime()", 60000 - (secs*1000));
}

// -->
</SCRIPT>
</HEAD>

<BODY onLoad="showtime()">
<FORM NAME="clock">
<P><STRONG>Current date and time:</STRONG>
<INPUT TYPE="text" NAME="display" SIZE="14"></P>
</FORM>

</body>
</html>

Hope it Helps
Peter Newton



Sam Wrote -----------------------------------------------


----- Original Message -----
From: "Sam" <ssendon(at)icqmail.com>
To: <hwg-techniques(at)hwg.org>
Sent: Thursday, January 20, 2000 2:11 AM
Subject: Date Script that refreshes itself


> http://members.xoom.com/_XMCM/ssendon/nfsitev2/index.html
>
> Hello again,
>
> Actually, I have already sent this type of message before but did not get
any response.  I am re-writing my prev email for those who haven't read my
prev email concerning the same subject.
>
> I made a page that uses a few Javascripts including it's Date script.  I
wanted  the script to refresh everytime the minute changes so as to be
almost in synchrony with the client's system date.  To do this, i placed the
script in a floating frame and placed a meta tag to refresh the time page
every ten seconds.  The problem I am encoutering right now is the existence
of up and down arrow heads in the Floating frame when viewed in IE5... I
also tried to view it in IE4 and it shows ok without those up and down arrow
heads... but in IE5, well...
>
> anyway, my other option is to look for a script that will refresh my the
date only (every seconds, if possible) without refreshing the whole page.
Presently, I only have a rough idea.  Anyway, I hope you could give me more
options.
>
> Thanks for your replies... =)
>
> Sam
>
>
>
> -------------------------------------------------------------
> Sign up for ICQmail at http://www.icq.com/icqmail/signup.html
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA