返回当前时间获取和......登陆

当前时间获取和输出

fhp2019-02-07 11:11:47221

<!DOCTYPE html>

<html>

<head>

<title>switch</title>

</head>

<body>


<script type="text/javascript">

var mynow=new Date();

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



var arr_month=new Array(

"1月",

"2月",

"3月",

"4月",

"5月",

"6月",

"7月",

"8月",

"9月",

"0月",

"11月",

"12月"

);

var x;

for (x in arr_month){

document.write(arr_month[x]+"<br>")

}


function myyear() {

document.write(mynow.getFullYear()+"年");

}


function mymonth(){

document.write(arr_month[mynow.getMonth()]);

}

function mydate(){

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

}


function week(){

if (mynow.getDay()==0)

{

document.write(" 星期日")

}

else

{

document.write(" 星期"+mynow.getDay())

}


}


function myhours(){

document.write(" "+mynow.getHours()+"时")

}


function myminutes(){

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

}


function mysec(){

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

}

myyear();

mymonth();

mydate();

week();

myhours();

myminutes()

mysec()

</script>


</body>

</html>


最新手记推荐

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

全部回复(0)我要回复

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