<html>
<head>
<script type="text/javascript">
function moreThanOneMonth(dt)
{
var s1=new Date(dt.replace(/-/g, "/")); //日期格式为yyyy-mm-dd转换成yyyy/mm/dd
var s2=new Date();
var time= s2.getTime() - s1.getTime();
var days = parseInt(time / (1000 * 60 * 60 * 24));
if(days > 30)
return true;
else
return false;
}
function load(dt)
{
if( checkDate(dt) )
{
alert("days > 30");
}
else
{
alert("days < 30");
}
}
</script>
</head>
<body onLoad="load('2013-01-01')">
</body>
</html>
posted on 2013-02-26 10:00
Ke 阅读(554)
评论(0) 编辑 收藏 所属分类:
javascript