javascript - Date.parse, different date formats, different output problems
世界只因有你
世界只因有你 2017-05-19 10:41:58
0
1
497

I guess 2017/04/04 is parsed according to the local time zone, and 2017-04-14 is parsed according to Greenwich Time because the time zone is not specified? ? ? ? ?

If the input date does not specify a time zone, the parsing will be different. When 8 is added after 2017-04-14, the parsing result is the same as that of 2017/04/14.

Why does adding 00:00:00 at the end result in the same analysis?

世界只因有你
世界只因有你

reply all (1)
我想大声告诉你

This is a breaking change in the ES 6 specification. As early as 2015, someone had submitted a related issue to Chrome: https://bugs.chromium.org/p/c...

For more detailed information, please refer to my previous answer on Zhihu About JavaScript's new Date, a strange date behaves differently in Firefox and Chrome?

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!