1969年12月31日下午7:00发生了什么 [英] What happened on Dec 31 1969 at 7:00 PM
问题描述
每次在PHP中创建这样的变量时:
Every time in PHP when I make a variable such as this one:
$date = strtotime($row['date']);
$date = date("M d Y \a\\t g:i A", $date); // Mmm dd YYYY at h:mm PM/AM
,然后以某种方式 row ['date']
恰好是0,屏幕上显示的日期 1969年12月31日7:00 PM
? Google没有告诉我太多,我想知道这个日期是否有意义。
and somehow row['date']
happens to be 0, the date Dec 31 1969 at 7:00 PM
is displayed on the screen? Google does not tell me much, I was wondering if this date had any significances.
推荐答案
Unix时代是00: 1970年1月1日世界标准时间00:00。这是所有时间戳的参考点。使用PHP的日期/时间功能时,您始终要使用自纪元以来的秒数。时间0是时代,您(或您的Web服务器)必须位于美国东海岸,比世界标准时间晚5个小时。
The Unix epoch is the time 00:00:00 UTC on 1 January 1970. This is the reference point for all time stamps. When you use PHP's date/time functions, you're always working with the number of seconds since the epoch. Time 0 is the epoch, and you (or your web server) must be on the east coast of the US, which is 5 hours behind UTC time.
这篇关于1969年12月31日下午7:00发生了什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!