日期处理,各浏览器字符串转日期格式兼容性测试

测试代码:

日期处理,各浏览器字符串转日期格式兼容性测试_第1张图片
 

 

 

IE浏览器()

日期代码 浏览器响应
new Date("February 3,2009") Tue Feb 3 00:00:00 UTC+0800 2009
new Date("February 3,2009 10:52:03") Tue Feb 3 10:52:03 UTC+0800 2009
new Date(2009,1,3) Tue Feb 3 00:00:00 UTC+0800 2009
new Date(2009,1,3,10,52,03) Tue Feb 3 10:52:03 UTC+0800 2009
new Date(Date.parse("February 3,2009")) Tue Feb 3 00:00:00 UTC+0800 2009
new Date(Date.parse("February 3,2009 10:52:03")) Tue Feb 3 10:52:03 UTC+0800 2009
new Date(Date.parse(2009,1,3)) NaN
new Date(Date.parse(2009,1,3,10,52,03)) NaN
new Date(Date.parse("2014-12-23 10:52:03")) NaN
new Date(Date.parse("2014/12/23 10:52:03")) Tue Dec 23 10:52:03 UTC+0800 2014
new Date(Date.parse("2009/02/03")) Tue Feb 3 00:00:00 UTC+0800 2009
new Date("2009/02/03") Tue Feb 3 00:00:00 UTC+0800 2009
new Date("2009/02/03 11:12:13") Tue Feb 3 11:12:13 UTC+0800 2009
new Date("2009-02-03") NaN

 

 


webkit

 

日期代码 浏览器响应
new Date("February 3,2009") Tue Feb 03 2009 00:00:00 GMT+0800 (中国标准时间)
new Date("February 3,2009 10:52:03") Tue Feb 03 2009 10:52:03 GMT+0800 (中国标准时间)
new Date(2009,1,3) Tue Feb 03 2009 00:00:00 GMT+0800 (中国标准时间)
new Date(2009,1,3,10,52,03) Tue Feb 03 2009 10:52:03 GMT+0800 (中国标准时间)
new Date(Date.parse("February 3,2009")) Tue Feb 03 2009 00:00:00 GMT+0800 (中国标准时间)
new Date(Date.parse("February 3,2009 10:52:03")) Tue Feb 03 2009 10:52:03 GMT+0800 (中国标准时间)
new Date(Date.parse(2009,1,3)) Thu Jan 01 2009 08:00:00 GMT+0800 (中国标准时间)
new Date(Date.parse(2009,1,3,10,52,03)) Thu Jan 01 2009 08:00:00 GMT+0800 (中国标准时间)
new Date(Date.parse("2014-12-23 10:52:03")) Tue Dec 23 2014 10:52:03 GMT+0800 (中国标准时间)
new Date(Date.parse("2014/12/23 10:52:03")) Tue Dec 23 2014 10:52:03 GMT+0800 (中国标准时间)
new Date(Date.parse("2009/02/03")) Tue Feb 03 2009 00:00:00 GMT+0800 (中国标准时间)
new Date("2009/02/03") Tue Feb 03 2009 00:00:00 GMT+0800 (中国标准时间)
new Date("2009/02/03 11:12:13") Tue Feb 03 2009 11:12:13 GMT+0800 (中国标准时间)
new Date("2009-02-03") Tue Feb 03 2009 08:00:00 GMT+0800 (中国标准时间)

你可能感兴趣的:(JavaScript)