4 ms·
The whole reason months start at zero is because somebody wanted to work with them as raw numbers.
by IshKebab 5y ago
The whole reason months start at zero is because somebody wanted to work with them as raw numbers.
- cunthorpe 5y agoYes 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.
- globular-toast 5y agoSo 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`?