javascript string 转 date

function StringtoDate(strDate) {
var date = new Date(strDate.replace(
/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/,
//'$4:$5:$6 $2/$3/$1'
'$1/$2/$3 $4:$5:$6'
));

return date;
}

posted on 2014-06-27 14:43  marcozzu2  阅读(142)  评论(0)    收藏  举报