ブラウザーの日付と時刻に表示しようとしましたが、出力が間違っています。
多分私は何かを見逃していますが、それが何であるかを理解できませんか?
エンコーディングはANSI
.
出力:
Current date and time
- すべて出力です。
コード:
<HTML>
<HEAD><TITLE>Show date‹</TITLE></HEAD>
<BODY>
<H1>Current date and time</H1>
<p>
<SCRIPT LANGUAGE="JavaScript">
now = new Date();
localtime = now.toString();
utctime = now.toGMTString();
hours = now.getHours();
mins = now.getMinutes();
secs = now.getSeconds();
document.write("<b>Current time: </b>" + localtime + "<BR>");
document.write("<b>Asolute time: </b>" + utctime + "</p>");
document.write("<font size='+5'>");
document.write(hours + ":" + mins + ":" + secs);
document.write("</font>);
</SCRIPT>
</BODY>
</HTML>
質問:
- この問題をどのように解決しますか?