JQuery 字符串转时间格式

//字符串转时间格式
function getDate(strDate) {
var date = eval('new Date(' + strDate.replace(/\d+(?=-[^-]+$)/,
function (a) { return parseInt(a, 10) - 1; }).match(/\d+/g) + ')');
return date;
}

posted @ 2014-10-10 15:40  jyb2014  阅读(1940)  评论(0编辑  收藏  举报