Image missing.
Never write your own date parsing library

ulrischa

created: July 25, 2025, 5:36 p.m. | updated: July 26, 2025, 8:57 p.m.

Never write your own date parsing library. Never have I ever…So… I’ve written my own date parsing library. Breaking ChangesMost date parsing woes (in my opinion) come from ambiguity: from supporting too many formats or attempting maximum flexibility in parsing. There are a few notable differences:Format ISO 8601 Date.parse * luxon RFC 9557 YYYY Supported Supported Supported Unsupported YYYY-MM Supported Supported Supported Unsupported YYYY-MM-DD Supported Supported Supported Supported ±YYYYYY-MM-DD Unsupported Supported Supported Supported Optional - delimiters in dates Supported Unsupported Supported Supported YYYY-MM-DDTHH Supported Unsupported Supported Supported YYYY-MM-DD HH (space delimiter) Unsupported Supported Unsupported Supported YYYY-MM-DDtHH (lowercase delimiter) Unsupported Supported Face looking surprised Supported Face looking surprised Supported YYYY-MM-DDTHH:II Supported Unsupported Supported Supported YYYY-MM-DDTHH:II:SS Supported Unsupported Supported Supported Optional : delimiters in time Supported Unsupported Supported Supported YYYY-MM-DDTHH:II:SS.SSS Supported Supported Face looking surprised Supported Supported YYYY-MM-DDTHH:II:SS,SSS Supported Unsupported Supported Supported Microseconds (6 digit precision) Supported Unsupported Supported Supported Nanoseconds (9 digit precision) Supported Unsupported Supported Supported YYYY-MM-DDTHH.H Fractional hours Supported Unsupported Unsupported Unsupported YYYY-MM-DDTHH:II.I Fractional minutes Supported Unsupported Unsupported Unsupported YYYY-W01 ISO Week Date Supported Unsupported Supported Unsupported YYYY-DDD Year Day Supported Unsupported Supported Unsupported HH:II Supported Unsupported Supported Unsupported YYYY-MM-DDTHH:II:SSZ Supported Unsupported Supported Supported YYYY-MM-DDTHH:II:SS±00 Supported Unsupported Supported Supported YYYY-MM-DDTHH:II:SS±00:00 Supported Unsupported Supported Supported YYYY-MM-DDTHH:II:SS±0000 Unsupported Face looking surprised Unsupported Supported SupportedUnsupported Inaccurate parsing Face looking surprised Surprising (to me)* Note that Date.parse results may be browser/runtime dependent. Late AdditionsFor posterity, here are a few other alternative date libraries / Temporal polyfills that I think are worth mentioning (and might help you in different ways on your own date parsing journey):

1 day, 13 hours ago: Hacker News: Front Page