【文件属性】:
文件名称:JS简单获取及显示当前时间的方法
文件大小:34KB
文件格式:PDF
更新时间:2021-01-19 20:36:17
javascript js 方法
本文实例讲述了JS简单获取及显示当前时间的方法。分享给大家供大家参考,具体如下:
<!DOCTYPE html>
<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv=Content-Type content=text/html; charset=gb2312 />
<title>当前时间</title>
</head>
<body>
[removed]
var now = new Date();
var year = now.getFullYear(); //年
var month = now.