IOS时间转时间戳出现Invalid Date的问题
方法一:
var endTime = new Date('2018/08/10 11:59:59') alert(endTime.getTime())
方法二:
varendTime = new Date("Jan 1, 1970 00:00:00") console.log(endTime.getTime());
方法三:
var endTime = '2018-08-10 11:59:59'; var endTime = endTime.replace(/-/g,'/'); alert(endTime); var time = Date.parse(new Date(endTime))/1000; alert(time)