Comment by Yaggo

Comment by Yaggo 6 hours ago

1 reply

The old JS Date API is far from perfect and I'm happy it being replaced, but part of the problem is various string-based formats and people being sloppy using them. Not to mention general complexity in time/date concept with timezones, summer time, leap seconds, etc.

For string format, just stick with ISO 8601. If you need to parse less-standard formats, use a robust library of your choise. The standard library should not try to support parsing zillion obscure formats. Outputting localized / human-readable format should be a responsibility of localization API anyway.

I also think that many libraries/APIs involving formatting things have some US centric design limitations, i.e. tendency to treat US formats as native and international support is often a bit after-thought. Especially with older stuff like the JS Date API.

ReptileMan 4 hours ago

The problem with the date format is that the US one absolutely totally insane. Whenever you use something ordered you have to choose ordering. For date US choose the absurd kind. Y-d-m should never have been used. Remove that and around 90% of the string based format problems disappear.