页面使用倒计时时发现:
ios手机使用new Date('2018-11-30 23:55:00').getTime()出错,打印一直是NaN;
但是安卓手机是好的;
最终发现问题症结:是日期格式(2018-11-30 23:55:00)不兼容IOS系统,需要转化成(2018/11/30 23:55:00);
举例如下:
var timeChose = that.data.pleaseChoseTime
console.log(timeChose) //2018-05-06 11:18
var timeStampChose = new Date(timeChose.replace(/-/g, '/')).getTime() //兼容 苹果机选择的时间戳