Syntax:
UNIX_TIMESTAMP([date])

If UNIX_TIMESTAMP() is called with no date argument, it returns a Unix
timestamp representing seconds since '1970-01-01 00:00:00' UTC.

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. The
server interprets date as a value in the session time zone and converts
it to an internal Unix timestamp value in UTC. (Clients can set the
session time zone as described in
https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html.) The
date argument may be a DATE, DATETIME, or TIMESTAMP string, or a number
in YYMMDD, YYMMDDhhmmss, YYYYMMDD, or YYYYMMDDhhmmss format. If the
argument includes a time part, it may optionally include a fractional
seconds part.

The return value is an integer if no argument is given or the argument
does not include a fractional seconds part, or DECIMAL if an argument
is given that includes a fractional seconds part.

When the date argument is a TIMESTAMP column, UNIX_TIMESTAMP() returns
the internal timestamp value directly, with no implicit
"string-to-Unix-timestamp" conversion.

Prior to MySQL 8.0.28, the valid range of argument values is the same
as for the TIMESTAMP data type: '1970-01-01 00:00:01.000000' UTC to
'2038-01-19 03:14:07.999999' UTC. This is also the case in MySQL 8.0.28
and later for 32-bit platforms. For MySQL 8.0.28 and later running on
64-bit platforms, the valid range of argument values for
UNIX_TIMESTAMP() is '1970-01-01 00:00:01.000000' UTC to '3001-01-19
03:14:07.999999' UTC (corresponding to 32536771199.999999 seconds).

Regardless of MySQL version or platform architecture, if you pass an
out-of-range date to UNIX_TIMESTAMP(), it returns 0. If date is NULL,
it returns NULL.

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

