The funny part is that JavaScript copied this behaviour from Java for compatibility (in fact most of JavaScript's Date's behaviour is a direct copy of Java's).
I didn't know that this is one case where Java copied from C, which means JS copied it from Java and Java copied it from C (which itself seems to have inherited it via POSIX), all in the name of API compatibility but confusing the majority of programmers in each language every time.