Date.parse() gets the timestamp IOS is not compatible

I wrote a small program recently, new Date ('2018-12-17 13:12') is displayed normally on the computer, and it is also normal when using the developer tools to debug on the real machine. When it is placed on the mobile phone, it reports an error. At first, I thought it was the time. There must be seconds.

It took a while to remember that the time format of ios must be 2018/12/17

ios does not support the 2018-12-17 wording, so-must be replaced with /

var date = '2018-12-17 13:33'

Date.parse(new Date(date.replace(/-/g, '/')));

This problem will be encountered once in a while, and every time I forget this point...

Guess you like

Origin blog.csdn.net/qq_37514029/article/details/85052064