JQuery 字符串转时间格式

时间:2014-10-10 16:28:25   收藏:0   阅读:136

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

原文:http://www.cnblogs.com/jyb2014/p/4016043.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!