Home  >  Article  >  Database  >  What output does the UNIX_TIMESTAMP() function produce?

What output does the UNIX_TIMESTAMP() function produce?

PHPz
PHPzforward
2023-09-02 13:05:06796browse

UNIX_TIMESTAMP() 函数产生什么样的输出?

Function UNIX_TIMESTAMP generates output in seconds, i.e. this function converts the specified date or datetime value into a total number of seconds.

For example, the date '1970-05-15 05:04 :30' will be converted to a total of 11576070 seconds by the UNIX_TIMESTAMP function.

mysql> select UNIX_TIMESTAMP('1970-05-15 05:04:30');
+---------------------------------------+
| UNIX_TIMESTAMP('1970-05-15 05:04:30') |
+---------------------------------------+
| 11576070                              |
+---------------------------------------+
1 row in set (0.09 sec)

The above is the detailed content of What output does the UNIX_TIMESTAMP() function produce?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete