比较日期大小

来源:互联网 发布:手机淘宝能买彩票吗 编辑:程序博客网 时间:2024/06/09 17:09

<script>
function CompareDate(d1,d2)
{
   return ((new Date(d1.replace(/-/g,"//"))) > (new Date(d2.replace(/-/g,"//"))));
}

var current_time = "2007-02-02 7:30";
var stop_time = "2007-01-31 8:30";
alert(CompareDate(current_time,stop_time));

</script>

原创粉丝点击