UNIX_TIMESTAMP()
UNIX_TIMESTAMP([date
])
If called without the optional date
argument, this function returns the number of seconds since 1970-01-01
00:00:00 UTC as an unsigned integer. If the
date
parameter is passed, then the value
returned is the number of seconds elapsed from the 1970 start date to
the given date. This code will return the value 946684800
(the number of seconds up to the
start of the current millennium) followed by a TIMESTAMP
representing the current Unix time
at the moment you run it:
SELECT UNIX_TIMESTAMP('2000-01-01'); SELECT UNIX_TIMESTAMP();