Click to See Complete Forum and Search --> : how could i do this?


sciguyryan
08-11-2003, 08:08 AM
hi all,

could some one provide a code to do thes?:

i would like a code that writes the time and date onto the page on load. could this be done? and, if so how?

if anyone could provide a code i would be most greatfull.;) ;)

pyro
08-11-2003, 08:26 AM
<script type="text/javascript">
document.write (new Date());
</script>

sciguyryan
08-11-2003, 08:35 AM
hi,


thanx pyro that was exactly what i needed dut, when it is displayed it has this:

Mon Aug 11 14:31:19 UTC+0100 2003 WHAT IS THE red bit for and what does it mean?

Charles
08-11-2003, 09:54 AM
That means that the time is offset one hour from Universal Time. UTC is sort of like GMT except that leap seconds are ignored.

If you don't like that format you can use new Date().toLocaleString() to have the date and time formatted according to the user's preference or we can write a routine that will format it any way that you the web author would prefer.

sciguyryan
08-11-2003, 01:20 PM
hi,


thanks Charles.

nkaisare
08-11-2003, 03:26 PM
So, the visitors to your site are so dumb that they can't figure out what the current time is unless they visit your site?

sciguyryan
08-11-2003, 03:40 PM
hi,





no, it's the idea. i like people to know the time etc wile on my site thats all.

pyro
08-11-2003, 03:47 PM
On my computer, I can look down to the lower-right hand side and get the current time (not even just the time I started viewing your page -- what if I'm on the page for 10 minutes?)

sciguyryan
08-11-2003, 03:50 PM
hi,

i ee your point but, still i lke the time there it filles the blankpart of my page!