js兼容问题

132 阅读1分钟

1.new Date(date).getTime()在苹果手机不兼容

解决方法:

new Date(data.replace(/-/g,'/')).getTime()
data是字符串,格式类似于:‘2018-09-09 23:23:23’