Solve ios parsing new Date time error method

Solution 1:

new Date ("2018-06-14 00:00:00" .replace (/-/ g, '/')). getTime ()
Solution 2:

new Date ("2018/06/14 00:00:00"). getTime ()
If according to the normal writing
new Date ("2018-06-14 00:00:00"). getTime ();
NaN is displayed in ios, If you follow

new Date('2018','06','14','00','00','00')

Published 80 original articles · Likes5 · Visits 40,000+

Guess you like

Origin blog.csdn.net/qq_28473733/article/details/103310998