1. 蘋果手機時間格式轉換時,要求2019/07/04,2019-07-04這種不行,replace(/\-/g, "/")處理,不處理的話new Date()的時候會出問題(ios上面不支持-格式的時間轉化)
2. ios new Date()格式轉換時,除了不允許年-月-日,也不允許new Date(任何格式的 年月,如年-月或年/月)
let date = "2020-04-07"; let iosDate = new Date(date.replace(/\-/g, "/")) console.log("iosDate", iosDate) // 2020/04/07