HN Top New Show Ask Jobs

settings

Theme

Hand Mode

Feed

Comment by lightningspirit

Comment by lightningspirit 5 hours ago

0 replies

View on Hacker News

If you do `new Date('2025-11-31T00:00:00Z')` you get `2025-12-01T00:00:00.000Z`, which is weird and potential cause for bugs when parsing date string from input. Right because of these inconsistency I created a small package backed as Regex to validate Date string input before throwing it on `new Date(stringDate)`.

https://www.npmjs.com/package/iso-8601-regex