这是一组代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="www.w3.org/1999/xhtml" xml:lang="en">
<title>Lots of Time</title>
<body>
<h1>Times</h1>
<script "type/javascript">
now = new Date();
localtime = now.toString();
utctime = now.toGMTString();
hours = now.getHours();
mins = now.getMinutes();
secs = now.getSeconds();
milli = now.getMilliseconds();
document.write("<h2>Local time:</h2> " + localtime + "<br/>");
document.write("<h2>UTC time</h2> " + utctime);
document.write("<h1>");
document.write(hours + ":" + mins + ":" + secs + ":" milli);
document.write("</h1>");
document.write("<h1>");
document.write(hours + ":" + mins + ":" + secs + ":" milli);
document.write("</h1>");
</script>
</body>
</html>
一切正常,直到我添加了 getMilliseconds();
任何帮助将非常感激。真诚的,艾琳