Click to See Complete Forum and Search --> : GMT only Script


rmdosb
10-01-2003, 02:24 AM
Does anyone have a GMT ONLY script:
Day MM DD YY GMT (hh:mm::ss) GMT that reads ideally in digital format from http://www.timeanddate.com/worldclock/ (or the like) OR from my own CPU.

Example appears at:
http://www.maitreyaproject.org/nav/index.html which is a frame and I do not know how to access the script using VIEW/Frame, etc. - I do not find it.
Thank you.

Gollum
10-01-2003, 02:51 AM
Those times you see (on both sites) are not Javascript generated - they're generated on the server.

but if you REALLY wanted to generate GMT time with Javascript you could do this...

<script>
var d = new Date;
document.write(d.toUTCString().replace("UTC","GMT"));
</script>

Charles
10-01-2003, 05:26 AM
Originally posted by Gollum


<script>
var d = new Date;
document.write(d.toUTCString().replace("UTC","GMT"));
</script>
1) That's invalid.

2) It needlessly clutters up the name space and it takes up unnecessary garbage collection time.

Use instead:

<script type="text/javascript>
document.write(new Date().toUTCString.replace('UTC', 'GMT'))
</script>