怎么编写小时、分钟、秒网页代码?

来源:百度知道 编辑:UC知道 时间:2024/06/19 01:48:46
<script language=vbscript>
if hour(now)=8 or hour(now)=20 then
document.location.href="111.html"
end if
</script>
这是在设定的小时跳转到某网页,我想编写具体到分和秒。比如:20:15:30应该怎么写?

使用相应的分和秒的函数minute(now)、second(now)代替小时函数hour(now),就能获取当前的分秒,比如:

'这样实现8时20分跳转
if hour(now)=8 and minute(now)=20 then
document.location.href="111.html"
end if