tc39 / proposal-uniform-interchange-date-parsing

Proposal to standardize Date.parse behavior for interchange-like input
https://tc39.github.io/proposal-uniform-interchange-date-parsing/
MIT License
31 stars 10 forks source link

Require acceptance of leap seconds? #5

Open gibson042 opened 6 years ago

gibson042 commented 6 years ago

Example: 2016-12-31T23:59:60Z

@mj1856 observed that parsing externally-generated input is an important use case, and some of that input will come from systems with leap-second support. Should we standardize acceptance of such date-time strings and their specific treatment? What about input with seconds "60" that is known not to not have been a leap second, or input that is in the future?

mattjohnsonpint commented 6 years ago

There's no way to validate that a :60 actually belongs to a leap second, unless we have access to a leap second table. For the Date object, I recommend that if :60 is encountered in parsing, it should be treated as :59, without any further validation.