字符串转为日期对象

IE8、Chrome、猎豹6有效,其它未测试

var timestr = "2017-05-15T09:30:21Z";
timestr = timestr.replace(/(\d{4})-(\d{2})-(\d{2})T(.*)?/, "$1/$2/$3 $4");
new Date(timestr)
var timestr = '2014-02-26T21:18:02.497'
var timestr = timestr .replace(/(\d{4})-(\d{2})-(\d{2})T(.*)?\.(.*)/, "$1/$2/$3 $4")
new Date(timestr )

[ 编辑 | 历史 ]
最近由“jilili”在“2017-05-15 01:33:26”修改