mysql數據庫將BIGINT轉換成一個日期

-- 假設 1164691264437 是 Java 裏的“日期時間”:即:自1970-01-01 00:00:00以來的毫秒數
/*
getTime
public long getTime()Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.

Returns:
the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this date.
*/
mysql> select from_unixtime(1164691264437/1000);
+-----------------------------------+
| from_unixtime(1164691264437/1000) |
+-----------------------------------+
| 2006-11-28 13:21:04               |
+-----------------------------------+
1 row in set (0.05 sec)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章