ios中new Date(time).getTime会报NaN 采用八进制形式计算
var isAndroid = navigator.userAgent.indexOf('Android') > -1
|| navigator.userAgent.indexOf('Adr') > -1; //判断是否是安卓系统var time = '需要转换的时间字符串'
if(isAndroid){
start = new Date(time).getTime();//时间戳
}else{
try{
start = eval("new Date("+ payTime.replace(/\D+/g,",") +")").getTime(); //时间戳 ios
}
catch(err){
console.log(err)
}
}
网友评论