What's the diffience between new Date("2019-05-10")
and new Date("2019/05/10")
and why?
I mean new Date("2019-05-10")
and new Date("2019/05/10")
they are different in the console result
What's the diffience between new Date("2019-05-10")
and new Date("2019/05/10")
and why?
I mean new Date("2019-05-10")
and new Date("2019/05/10")
they are different in the console result
I think there's some inconsistencies in date parsing and I found the following excerpt in mdn.
Parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. Support for RFC 2822 format strings is by convention only. Support for ISO 8601 formats differs in that date-only strings (e.g. "1970-01-01") are treated as UTC, not local.