MySQL Function Reference

UNIX_TIMESTAMP
Returns the Unix timestamp (number of seconds since 1970-01-01 00:00:00 UTC) for the given date or for the current date/time if no argument is given.
MySQL 8.1
UNIX_TIMESTAMP([date])
date
Optional. The date or datetime to convert to Unix timestamp. If omitted, returns the current timestamp.
Useful for converting dates to a numeric format for calculations, comparisons, or storage.
Examples
MySQL 8.1
SELECT UNIX_TIMESTAMP();
MySQL 8.1
SELECT UNIX_TIMESTAMP(date)
FROM Payments;
MySQL 8.1
SELECT member_name,
	UNIX_TIMESTAMP(birthday)
FROM FamilyMembers;