javascript比較日期

var myDate=new Date();
myDate.setFullYear(2008,8,9);

var today = new Date();

if (myDate>today)
{
alert("Today is before 9th August 2008");
}
else
{
alert("Today is after 9th August 2008");
}
http://www.w3school.com.cn/js/js_obj_date.asp

留言

這個網誌中的熱門文章

PHP讀資料庫的資料,保留換行及空格

CSS animation 簡寫&好用的工具

使陣列裡的數值隨機重新排序