返回时间对象的学习...登陆

时间对象的学习

董锋2019-02-23 14:35:59236

<!DOCTYPE html>

<html>

<head>

    <title>Date(日期操作方法)</title>

</head>

<body>

<script type="text/javascript">


var dd=new Date()

document.write(dd+"<br>")


document.write(dd.getFullYear()+"年")

document.write(dd.getMonth()+"月")

document.write("<br>")

var month=new Array(12)

month[0]="一月"

month[1]="二月"

month[2]="三月"

month[3]="四月"

month[4]="五月"

month[5]="六月"

month[6]="七月"

month[7]="八月"

month[8]="九月"

month[9]="十月"

month[10]="十一月"

month[11]="十二月"

document.write("这个月是"+month[dd.getMonth()])

 

document.write("今天是星期"+dd.getDay())

 

document.write("今天是这个月的第"+dd.getDate()+'天')

document.write("<br>")

document.write("现在是"+dd.getHours()+"时")

 

document.write(dd.getMinutes()+"分")


document.write(dd.getSeconds()+"秒")


</script>

</body>

</html>


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送