JavaScript Date Parsing Chaos
> String(new Date("2018/01/01")); < "Mon Jan 01 2018 00:00:00 GMT-0800 (Pacific Standard Time)" > String(new Date("2018-01-01")); < "Sun Dec 31 2017 16:00:00 GMT-0800 (Pacific Standard Time)" >
A JavaScript console shows two nearly identical date strings producing different results: the slash-separated date is interpreted as January 1, while the hyphen-separated date becomes December 31 at 4 PM in the previous time zone. The joke mocks JavaScript's confusing and inconsistent date parsing, making it useful as a reaction to bizarre programmer behavior. EN: A JavaScript console shows two nearly identical date strings producing different results: the slash-separated date is interpreted as January 1, while the hyphen-separated date becomes December 31 at 4 PM in the previous time zone. The joke mocks JavaScript's confusing and inconsistent date parsing, making it useful as a reaction to bizarre programmer behavior.
- @ithueti / 642 2019-02-25
- Type
- image
- Size
- 800×192 · 36.5 KiB
- Mood
- absurd, sarcastic
- Language
- en
- Added