js Date问题

 

javascript中Date对象实例化差别问题:

 

new Date("2015-04-05")
Sun Apr 05 2015 08:00:00 GMT+0800 (CST)
new Date("2015-04-5")
Sun Apr 05 2015 00:00:00 GMT+0800 (CST)
new Date("2015-4-05")
Sun Apr 05 2015 00:00:00 GMT+0800 (CST)
new Date("2015-4-5")
Sun Apr 05 2015 00:00:00 GMT+0800 (CST)

===================================================
new Date("2015/04/05")
Sun Apr 05 2015 00:00:00 GMT+0800 (CST)
new Date("2015/04/5")
Sun Apr 05 2015 00:00:00 GMT+0800 (CST)
new Date("2015/4/05")
Sun Apr 05 2015 00:00:00 GMT+0800 (CST)
new Date("2015/4/5")
Sun Apr 05 2015 00:00:00 GMT+0800 (CST)

 

    总结:还是(/)分隔符比较符合大众口味 ,原因还在研究,有知道的同学,告诉我

 

你可能感兴趣的:(自己编写,javascript)