3 ms·
It took nearly 20 years to sort it out. Before Java 8, January was 0 and getYear() for today would return 125.
by badlibrarian 2y ago
It took nearly 20 years to sort it out. Before Java 8, January was 0 and getYear() for today would return 125.
- stefanfisk 2y agoWasn’t Java 8 released 11 years ago? If PHP had been in its current state back then it would have been a masterpiece.
- IshKebab 2y agoJanuary as 0 seems like a very definsible choice. Presumably they did it to match C. If anything the WTF there is that the day of the month doesn't start from 0. Dunno what's up with getYear() though!
- divbzero 2y agogetYear() must have been written in the 1990s during the early years of Java: 95 = 1995 96 = 1996 97 = 1997 98 = 1998 99 = 1999 100 = 2000 !?