Search code examples
language-agnostictimetimestampunix-timestampepoch

What is special about dates before the year 1970?


I see a lot of discussion about getting dates that are pre-1970. For example, I see people ask a question like, "how do I get a date before 1970?"

What I'd like to know is what is so special about 1970? Why do people have trouble getting dates before that particular year? Was it the beginning of the universe or something?


Solution

  • It is the beginning of the UNIX epoch, timestamp 0. All UNIX timestamps are the number of seconds since January 1st 1970 UTC. The moment of this writing is timestamp 1298440626.

    UNIX timestamps pop up in the datetime libraries of a lot of languages and software, as storing times as a number of seconds is convenient for various reasons.

    Since 1970 is time 0, dates before then can't typically be stored as timestamps.