js----Date

来源:互联网 发布:网络超市好开吗 编辑:程序博客网 时间:2024/05/17 05:08
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
/*
日期对象:(Date)


*/
var date=new Date();
document.write("年"+date.getFullYear()+"<br/>");
document.write("月:"+(date.getMonth()+1)+"<br/>");
document.write("日:"+date.getDate()+"<br/>")
document.write("时:"+date.getHours()+"<br/>");
document.write("分:"+date.getMinutes()+"<br/>");
document.write("秒:"+date.getSeconds()+"<br/>");


document.write("当前时间是:"+date.toLocaleString()+"<br/>")
document.write("当前时间是:"+date.getFullYear()+"年"+date.getMonth()+"月"+date.getDate()
+"日&nbsp;&nbsp;&nbsp;"+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()+"<br/>")
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Date对象</title>
</head>


<body>
</body>
</html>
0 0
原创粉丝点击