Converts a Unix timestamp to a DATETIME value or a formatted string. The inverse of UNIX_TIMESTAMP().
DATETIME | VARCHARDiperbarui: 13 Jun 2026FROM_UNIXTIME(unix_timestamp[, format])The Unix timestamp (seconds since epoch)
Optional output format string
1 SELECT FROM_UNIXTIME(1705320000) AS dt;
Convert a Unix timestamp to a readable datetime.
1 SELECT FROM_UNIXTIME(1705320000, '%Y-%m-%d') AS date_only;
Format the output to show only the date portion.
1 SELECT id, FROM_UNIXTIME(created_at) AS created_datetime 2 FROM api_events;
Convert Unix timestamps received from an API into readable datetimes.
Sudah paham FROM_UNIXTIME? Latih langsung di browser
Latihan interaktif, langsung di browser.