Топ-100
 

TO_SECONDS

RDBMS Type: MySQL
Topic

Syntax:
TO_SECONDS(expr)

Given a date or datetime expr, returns the number of seconds since the
year 0. If expr is not a valid date or datetime value, returns NULL.

URL: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html

Example

mysql> SELECT TO_SECONDS(950501);
-> 62966505600
mysql> SELECT TO_SECONDS('2009-11-29');
-> 63426672000
mysql> SELECT TO_SECONDS('2009-11-29 13:43:32');
-> 63426721412
mysql> SELECT TO_SECONDS( NOW() );
-> 63426721458