668
you are viewing a single comment's thread
view the rest of the comments
[-] viking@infosec.pub 25 points 11 months ago

What people fail to see is that this is the largest date the API can store, not a magical cutoff date in the distant future.

You could create a date today and send it to the API, and it could potentially crash it, or create a buffer overrun.

[-] Redkey@programming.dev 8 points 11 months ago

The definition of the Date object explicitly states that any attempt to set the internal timestamp to a value outside of the maximum range must result in it being set to "NaN". If there's an implementation out there that doesn't do that, then the issue is with that implementation, not the standard.

this post was submitted on 04 Nov 2023
668 points (98.0% liked)

Programmer Humor

19331 readers
92 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS