方法一:
<script language="javascript">
var d = new Date();
var diff = (15-d.getHours())*60*60-(d.getMinutes())*60-d.getSeconds();
alert( "距下午3点还有"+diff+"秒");
</script>
方法二:
<script language="javascript">
var s = new Date();
var s2 = new Date(s.getFullYear(),s.getMonth(),s.getDate(),15,0,0);
alert(Math.ceil((s2.getTime()-s.getTime())/1000));
</script>
posted on 2006-04-03 14:37
汪杰 阅读(288)
评论(0) 编辑 收藏 引用 所属分类:
javascript 、
hengxing网站js