JQ将字符串转化成date
var rTime = Date.parse(time.replace(/-/g, "/")); var rTimeDate = new Date(rTime); var rTimeYear = rTimeDate.getFullYear(); var rTimeMonth = rTimeDate.getMonth() + 1; var rTimeData = rTimeDate.getDate(); var rTimeDataHour=rTimeDate.getHours(); //获取当前小时数(0-23) var rTimeDataMin=rTimeDate.getMinutes(); //获取当前分钟数(0-59) var rTimeDataSecond=rTimeDate.getSeconds();
感谢:http://zisetoufa.iteye.com/blog/1545140
http://www.cnblogs.com/wangchuanfu/p/5794843.html