Returns the Unix timestamp (seconds since 1970-01-01 00:00:00 UTC). When called with no argument, returns the current Unix timestamp.
BIGINTDiperbarui: 13 Jun 2026UNIX_TIMESTAMP([date])The date to convert (optional)
1 SELECT UNIX_TIMESTAMP() AS now_unix;
Get the current Unix timestamp.
1 SELECT UNIX_TIMESTAMP('2024-01-15 12:00:00') AS ts;
Convert a specific date to its Unix timestamp.
1 SELECT UNIX_TIMESTAMP(end_time) - UNIX_TIMESTAMP(start_time) AS duration_sec 2 FROM sessions;
Calculate elapsed time in seconds between two timestamps.
Sudah paham UNIX_TIMESTAMP? Latih langsung di browser
Latihan interaktif, langsung di browser.