0

Its my first time using JavaScript I'm trying to make the utctime and localtime to appear, but its not showing what did I do wrong here?
http://i53.tinypic.com/358a22w.png My work

<HTML>
<head><title>Displaying Times and Dates</title></head>
<body>
<h1>Current Date and Time</h1>
<p>
<script language="JavaScript" type="text/javascript"> 
now = new Date(); 
localtime = now.toString();
 utctime = now.GMTString();
 document.Write ("<b>localtime</b>" + localtime + "</br>");
 document.Write("<b>utctime</b>" + utctime); 
 </script> 
</p>
</body>
</html>

Here's what it supposed to look like got it from the tutorial
http://i55.tinypic.com/wl4qar.png
http://i52.tinypic.com/1zyv7o9.png

I'm going to bed I hope tomorrow I get some answers.
Both this and the one I made didn't even show the current time

Edited by Punny: n/a

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by Punny
0

Its not showing up!

I am using an updated browser(IE9,Chrome,Opera,& Maxtor) and OS windows7 I even did what the guy told me to do and still not showing up.

1

No need to get frustrated, it could be that you are doing multiple things wrong (which you are). I only pointed out the one that jumped out at me right away, I didn't know you had 2 things wrong.

It is not GMTString(), it is toGMTString(). You might also want to make it so that any scripting errors show an error dialog.

<HTML>
<head><title>Displaying Times and Dates</title></head>
<body>
<h1>Current Date and Time</h1>
<p>
<script language="JavaScript" type="text/javascript">
now = new Date();
localtime = now.toString();
utctime = now.toGMTString();
document.write ("<b>localtime</b>" + localtime + "</br>");
document.write("<b>utctime</b>" + utctime);
</script>
</p>
</body>
</html>
0

Thank you from now on I'm using Dreamweaver CS.5 because it error check everything for and makes work much easier, it all started when I put your example into Dreamweaver and it work from there I was able to understand what I made a mistake on. I'm using Dreamweaver from now on.

Edited by Punny: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.