UNIX_TIMESTAMP([date])

Description: Returns the number of seconds since 1 January 1970 at 00:00:00 GMT, of date (a DATE or DATETIME type). If date is omitted, the current date and time are used.

Examples:

  • UNIX_TIMESTAMP('2002-01-05') returns 1010188800.

  • UNIX_TIMESTAMP() returns 1019582548.

See also: NOW(), FROM_UNIXTIME()

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.