Javascript/jQuery常用方法

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

 后续待补充

posted @ 2018-07-04 11:19  1nsist  阅读(101)  评论(0)    收藏  举报