我可以这样做是一个查询吗?
请参阅UNIX_TIMESTAMP()
函数。
This can be done in MySQL by using UNIX_TIMESTAMP() or UNIX_TIMESTAMP(date).
If called with no argument, this returns a Unix timestamp (seconds since '1970-01-01 00:00:00' UTC) as an unsigned integer.
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> SELECT UNIX_TIMESTAMP();
-> 1196440210
mysql> SELECT UNIX_TIMESTAMP('2007-11-30 10:30:19');
-> 1196440219
use the UNIX_TIMESTAMP()
function.
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_unix-timestamp
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.