Solution to uniapp applet Android and ios time compatibility problem

1.Problem description

In the ios applet, if the time format is 2022-12-09 10:10:10

new Date('2022-12-09 10:10:10') 

NaN or invalid Date (invalid value) will be reported,
but this problem will not occur in developer tools and Android phones.

2.Solution

Convert 2022-12-09 10:10:10 format to 2022/12/09 10:10:10

时间.replace(/-/g, '/') 

Insert image description here
Please support me by following me
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_47284756/article/details/128257872