News for hackers. Stuff that matters.
Re:Temporal: Getting started with JavaScript's new date time... by cunthorpe on Monday June 28, 2021 @10:49AM (#27662712)
No it doesn’t. Dates aren’t meant to be worked with as raw numbers, so the utility of 0-based numbers is gone and now you only have February ending on day number 27
Re:Temporal: Getting started with JavaScript's new date time... by globular-toast on Monday June 28, 2021 @11:15AM (#27663003)
If people don't work with them as numbers then the argument is completely moot. All you need is timestamps, deltas and formatting functions.

How many days is in the delta 1 hour? 1? or 0?

Re:Temporal: Getting started with JavaScript's new date time... by IshKebab on Monday June 28, 2021 @02:49PM (#27666020)
The whole reason months start at zero is because somebody wanted to work with them as raw numbers.
Re:Temporal: Getting started with JavaScript's new date time... by cunthorpe on Monday June 28, 2021 @09:46PM (#27670707)
Yes and they were wrong. There’s a whole “misconceptions programmers have about dates” you might want to read. The only number for dates is the Unix timestamp.
Re:Temporal: Getting started with JavaScript's new date time... by globular-toast on Tuesday June 29, 2021 @04:25AM (#27673281)
So if I want to have a style per month or something in my program, I'm wrong? If I want to select the next month's style I have to do something awkward like `(current mod 12) + 1` instead of the more natural `(current + 1) mod 12`?