unixtimestamp值不是衬垫?在下面的示例中,我期望599日期值小于第二个600值。
mysql> select from_unixtime(1289109599);
+---------------------------+
| from_unixtime(1289109599) |
+---------------------------+
| 2010-11-07 01:59:59 |
+---------------------------+
1 row in set (0.00 sec)
mysql> select from_unixtime(1289109600);
+---------------------------+
| from_unixtime(1289109600) |
+---------------------------+
| 2010-11-07 01:00:00 |
+---------------------------+
1 row in set (0.00 sec)
mysql> select from_unixtime(1289109601);
+---------------------------+
| from_unixtime(1289109601) |
+---------------------------+
| 2010-11-07 01:00:01 |
+---------------------------+
1 row in set (0.00 sec)
当我在其他服务器上尝试类似的命令时,我得到了以下输出......
mysql> select from_unixtime(1289120399);
+---------------------------+
| from_unixtime(1289120399) |
+---------------------------+
| 2010-11-07 01:59:59 |
+---------------------------+
1 row in set (0.00 sec)
mysql> select from_unixtime(1289120400);
+---------------------------+
| from_unixtime(1289120400) |
+---------------------------+
| 2010-11-07 01:00:00 |
+---------------------------+
1 row in set (0.00 sec)
mysql> select from_unixtime(1289120401);
+---------------------------+
| from_unixtime(1289120401) |
+---------------------------+
| 2010-11-07 01:00:01 |
+---------------------------+
1 row in set (0.00 sec)
更新:由于DST,我得到两个不同的unix时间值的相同时间戳。有趣的!
mysql> select from_unixtime(1289109600);
+---------------------------+
| from_unixtime(1289109600) |
+---------------------------+
| 2010-11-07 01:00:00 |
+---------------------------+
1 row in set (0.00 sec)
mysql> select from_unixtime(1289106000);
+---------------------------+
| from_unixtime(1289106000) |
+---------------------------+
| 2010-11-07 01:00:00 |
+---------------------------+
1 row in set (0.00 sec)