Earlier quoted context omitted.
You're correct about JS numbers. It works like this presumably because the implementation is written in C++ or the like and uses an int32 for this, because "25 days ought to be enough for everyone".
I thought most non-abandoned C/C++ projects have long switched to time_t or similar. 2038 is not that far in the future.
Linux and glibc only started supporting it on 32bit systems in the current decade.