1970年1月1日(00:00:00 GMT)Unix时间戳(Unix Timestamp)

今天在看 Python API 时,看到time模块: The epoch is the point where the time starts. On January 1st of that year, at 0 hours,the “time since the epoch” is zero. For Unix, the epoch is 1970. To find out what the epoch is, look at gmtime(0). 定义time从1970年1月1日开始,忽然想到在JAVA里,Oracle数据库时间也是从1970年1月1日开始计算。 比如java类代码: Date date = new Date(0); System.out.println(date); 打印出来的结果: Thu Jan 01 08:00:00 CST 1970 也是1970年1月1日,实际上时分秒是0点0分0秒(这里打印出来是8点,稍后会作解释)。 为什么这个时间会定义在1970年1月1日这个时候呢? 于是开始了Google,中文网页根本找不到答案。于是试着搜索英文关键字,在 Sun java 论坛总算找到准确的帖子: http://forums.sun.com/thread.jspa?threadID=595140&start=15 其中有一个回复: I suspect that Java was born and raised on a UNIX system....

2013-11-04 · 王二