r/ProgrammerHumor • • Oct 29 '26

Meme sleepyTime

Post image
659 Upvotes

24 comments sorted by

107

u/Mara_li Oct 29 '26

Well, Temporal is here now.

56

u/Anonymislim Oct 29 '26

Two bugs for the price of one: the wrong month, and a month that doesn’t exist.

5

u/a-r-c Oct 29 '26

Smarch 30th

155

u/the_horse_gamer Oct 29 '26

always remember that javascript's date library was copied from Java's (old one) so it's all their fault

82

u/Top-Permit6835 Oct 29 '26

Which was known to suck and has been replaced over a decade ago

28

u/the_horse_gamer Oct 29 '26

and now javascript's was replaced

8

u/Duck_Devs Oct 30 '26

Not only that, but java.time exists in Java 8, so codebases have zero excuses not to use it.

1

u/Alternative-Tie-4970 Oct 30 '26

Of... of course it was

1

u/Elomidas Nov 03 '26

"Sorry officer, I beat my son because my neighbour beats his son, so it's all his fault"

30

u/SuitableDragonfly Oct 29 '26

So hold up. You can create a date that references December 31 by creating it as January 365 in Javascript? What about January -1, does that one work too?

9

u/-Redstoneboi- Oct 29 '26 edited Oct 29 '26

yes it does, you can test it right now

1

u/mrnacknime Oct 31 '26

365 would probably be December 30 if Feb 29 always counts. But maybe it only does in actual leap years

1

u/Blue_Moon_Lake 29d ago

January 365 doesn't work one out of four years.

January 0 is the way to do it.

January -1 would be 30th December.

2

u/SuitableDragonfly 29d ago

Dying to know what lunatic thought that months should be zero based but days should still be one based. 

13

u/StrengthTheory Oct 29 '26

You deserve it if you handle something sensitive like subscriptions with raw Dates and not a library.

37

u/[deleted] Oct 29 '26

[removed] — view removed comment

3

u/FindOneInEveryCar Oct 29 '26

Because months are typically used as indexes to an array?

0

u/[deleted] Oct 29 '26

[removed] — view removed comment

4

u/FindOneInEveryCar Oct 29 '26

But you don't need an array for the day of the month. 8-)

If they started with zero for months but not for day of the week, that would be weird.

And obviously the whole thing is less than ideal but you take what you can get. Ideally, everything should be wrapped in a better object class and you should have a calendar table so you don't have to figure out month names, last day of the month, etc., on the fly.