test2_6_3.htm
来自「JavaScript_VBScript网页编程实例」· HTM 代码 · 共 50 行
HTM
50 行
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<script language="VBScript">
option explicit
dim mydate
mydate=#10/17/2000 6:19:20 PM#
document.write("示范用date对象时间: ")
document.write(mydate)
document.write("<br>")
document.write("该date对象的年份: ")
document.write(year(mydate))
document.write("<br>")
document.write("该date对象的月份: ")
document.write(month(mydate))
document.write("<br>")
document.write("该date对象的日期数: ")
document.write(day(mydate))
document.write("<br>")
document.write("该date对象是星期: ")
'注意VBScript星期数从星期天开始计,即星期日为1
document.write(weekday(mydate)-1)
document.write("<br>")
document.write("该date对象的小时数: ")
document.write(hour(mydate))
document.write("<br>")
document.write("该date对象的分钟数: ")
document.write(minute(mydate))
document.write("<br>")
document.write("该date对象的秒数: ")
document.write(second(mydate))
document.write("<br>")
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?