JS Date日期

//日期属性
var
td = new Date(); alert(  "getDate():" +td.getDate()+"\n" +      "getDay():" +td.getDay()+ "\n" +     "getMonth()" +td.getMonth()+"\n"+     "getFullYear()" +td.getFullYear()+"\n"+      "toString()" +td.toString()+"\n"+      "toTimeString()"+td.toTimeString()+"\n"+     "toDateString()"+td.toDateString()+"\n");
        

//日期默认构造格式"09-12-2013"
new Date("09-12-2013")  //正确
new Date("2013-12-09")  //错误
 

 

posted on 2013-09-23 08:19  笑剑钝  阅读(290)  评论(0编辑  收藏  举报

导航