求一个asp条件判断os时间语句..

来源:百度知道 编辑:UC知道 时间:2024/06/15 05:37:31
用javsscript写,判断系统当前时间.
如果时间在 06:00 - 12:00 ,显示:"现在是上午!"
如果时间在 12:01 - 18:00 ,显示:"现在是下午!"
如果时间在 18:01 - 24:00 ,显示:"现在是晚上!"
其他时间,显示:"over!"

以前写过,现在忘了,求高手写一个.. Thanks`~

<script type="text/javascript">
var thedate = new Date()
hh = thedate.getHours()
if (hh>6 && hh<=12){
document.write("现在是上午!")
}else if(hh>12 && hh<=18){
document.write("现在是下午!")
}else if (hh>18 && hh<=23){
document.write("现在是晚上!")
}else{document.write("over!")
}
</script>