使用比較毫秒如何在MySQL帶有給定日期
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using readline 5.0
我有一個表像這樣定義:
+-----------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------------+--------------+------+-----+---------+-------+
| id | bigint(20) | NO | PRI | | |
| user_id | bigint(20) | NO | MUL | | |
| directory_id | bigint(20) | NO | MUL | | |
| attribute_name | varchar(255) | NO | | | |
| attribute_value | varchar(255) | YES | | NULL | |
| attribute_lower_value | varchar(255) | YES | | NULL | |
+-----------------------+--------------+------+-----+---------+-------+
選擇了我最後的驗證時間ATTRIBUTE_VALUE返回
+-------------------+-----------------+
| attribute_name | attribute_value |
+-------------------+-----------------+
| lastAuthenticated | 1330380013284 |
+-------------------+-----------------+
如果我使用http://www.epochconverter.com/驗證該值,它說
Assuming that this timestamp is in milliseconds:
GMT: Mon, 27 Feb 2012 22:00:13 GMT
但如果我嘗試的代碼
mysql> select from_unixtime('1330380013284');
+--------------------------------+
| from_unixtime('1330380013284') |
+--------------------------------+
| NULL |
+--------------------------------+
任何人誰立即知道我在這裏失蹤以下行?
+1是很清楚。但aswer很容易:) – vulkanino 2012-02-28 14:00:20