返回日期对象获取月......登陆

日期对象获取月份

文昌2018-12-14 11:44:47203

<!DOCTYPE html>

<html>

<head>

<title>月份的获取</title>

</head>

<body>

<script type="text/javascript">

var myday=new Date()

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

document.write(myday.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[myday.getMonth()])


</script>

</body>

</html>


最新手记推荐

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

全部回复(0)我要回复

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