I wanted to check how a certain software reacts when I change my computer's date. But I could not change the system time to anything less than 1970. Why is that?
I wanted to check how a certain software reacts when I change my computer's date. But I could not change the system time to anything less than 1970. Why is that?
UNIX and POSIX-compliant systems encode system time ("Unix time") as the number of seconds elapsed since the start of the Unix epoch at 1 January 1970 00:00:00 UTC, excepting leap seconds which are not counted. The limitation was inherited from UNIX. 32-bit values meant, to get a reasonable degree of precision, Day Zero had to be pretty close, so that precluded going back to 0 A.D., or, more reasonably, 5780 years and change, since the date of this answer is 10 Adar 5780 {g}.
From the wikipedia:
Also an explanation:
On a UNIX (and Linux) system, the counter for the time is interpreted as an unsigned value of (milli)seconds, and zero is defined as 1970-01-01T00:00:00.000 UTC. If you want to set the system time to any date/time before that, you would have to set that counter to a negative value – something that does not work for an unsigned value (as it is unsigned …).
There are several explanations around why the creators of UNIX chose that point in time for the 'Begin of the Epoch', and I have no clue which one is correct. But their decision for 1970 is the reason why you can't set your system to an earlier time.