如何从 MySQL 中的 DateTime 实例获取自 '1970-01-01 00:00:01'
以来的总秒数?
最佳答案
您正在寻找 UNIX_TIMESTAMP()
。
见:http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_unix-timestamp
If UNIX_TIMESTAMP() is called with a date argument, it returns the value of the argument as seconds since '1970-01-01 00:00:00' UTC.
关于mysql - 如何将 DateTime 转换为 MySQL 中的数字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1921574/