//时间戳的转换function add0(m){return m<10?'0'+m:m }; function getDate(times) { var time = new Date(times); var y = time.getFullYear(); var m = time.getMonth() + 1; var d = time.getDate(); return y + '-' + add0(m) + '-' + add0(d);};