this post was submitted on 12 Jul 2025
148 points (99.3% liked)

Programmer Humor

37254 readers
28 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 

cross-posted from: https://programming.dev/post/33754840

new Date("wtf")

you are viewing a single comment's thread
view the rest of the comments
[–] mogoh@lemmy.ml 4 points 1 week ago (8 children)

Ok, I get that the Date API is problematic, but I wouldn't expect anything meaningfull from new Date("not a date").getTime() anyway. Why would you in the first place?

[–] blaue_Fledermaus@mstdn.io 14 points 1 week ago (1 children)

Parsing user input? Nonsense data coming from an API?

[–] pixely@lemmy.world 1 points 1 week ago* (last edited 1 week ago) (1 children)

If you’re expecting shit data then you’d have unit tests for those cases so you’d know what to expect.

[–] WildPalmTree@lemmy.world 4 points 1 week ago

Maybe you don't expect shit data; you just get it. I know, always expect it....

load more comments (6 replies)