返回javascr......登陆

javascript日期

奋斗的路上2019-03-18 17:07:56233

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>javascript日期</title>

</head>

<body>

<script type="text/javascript">

var myday=new Date()

//document.write(myday)

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

var month=new Array(12)

   month[0]="01月"

   month[1]="02月"

   month[2]="03月"

   month[3]="04月"

   month[4]="05月"

   month[5]="06月"

   month[6]="07月"

   month[7]="08月"

   month[8]="09月"

   month[9]="10月"

   month[10]="11月"

   month[11]="12月"

document.write(month[myday.getMonth()])

document.write(myday.getDate()+"日" )

document.write(myday.getHours()+"点" )

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

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

</script>

</body>

</html>

最新手记推荐

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

全部回复(0)我要回复

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