是否有一个 MySQL 函数可以将时间戳转换为datetime
. 我尝试了以下方法:
SELECT FROM_UNIXTIME(1337951145000);
但它返回null。
你的时间戳太长,试试
SELECT FROM_UNIXTIME(1337951145);
或者
SELECT FROM_UNIXTIME(1337951145.000);
Your timestamp is valid ok.
Currently, timestamps are either 10 or 13 digits. 13-digit Timestamps (such as yours) have an additional 3-digit microseconds.
But to my (Google's) knowledge, MySQL's functions only supports the short 32bit timestamp (and you are not the only one to hit this wall.
Hopefully they'll sort it out before 2038.
最大可表示时间为 2038-01-19。在 03:14:07 UTC,您的时间戳已经结束。