MySQL Unix Timestamp Converter
Convert Unix epoch timestamps to MySQL dates and back, then copy the FROM_UNIXTIME() and UNIX_TIMESTAMP() queries for your value.
Client-side only, nothing leaves your browser
Auto-detected: seconds · 3.7y ago
Conversions
MySQL SQL
SELECT FROM_UNIXTIME(1679616000);SELECT FROM_UNIXTIME(1679616000000 / 1000);SELECT DATE_ADD('1970-01-01 00:00:00', INTERVAL 1679616000 SECOND);SELECT FROM_UNIXTIME(1679616000, '%Y-%m-%d %H:%i:%s');MySQL Unix Timestamps & Epoch
MySQL turns Unix epoch seconds into a DATETIME with FROM_UNIXTIME() and goes the other way with UNIX_TIMESTAMP(). Both use the session time_zone, so the same epoch shows a different wall-clock time on a server set to a local zone. Run SET time_zone = '+00:00' first if you want UTC. A TIMESTAMP column stops at 2038-01-19 03:14:07 UTC, but on 64-bit builds of MySQL 8.0.28 and later the two functions accept values into the year 3001.
Quick Reference
- FROM_UNIXTIME(epoch): Epoch seconds to DATETIME, in the session time zone
- FROM_UNIXTIME(epoch, fmt): Epoch seconds to a formatted string
- UNIX_TIMESTAMP(dt): DATETIME to epoch seconds
- CONVERT_TZ(dt, from, to): Shift a DATETIME between time zones
- UTC_TIMESTAMP(): Current UTC date and time
Notable Epoch Values
| Event | Epoch (seconds) | Date |
|---|---|---|
| Unix Epoch | 0 | January 1, 1970 00:00:00 UTC |
| 1 Billion | 1000000000 | September 9, 2001 01:46:40 UTC |
| Y2K38 (32-bit limit) | 2147483647 | January 19, 2038 03:14:07 UTC |
| 2 Billion | 2000000000 | May 18, 2033 03:33:20 UTC |
| Current (approx) | ~1774000000 | March 2026 |
Frequently asked questions
What does FROM_UNIXTIME do?
What data type should I use for a Unix timestamp in MySQL?
Does MySQL UNIX_TIMESTAMP use the time zone?
How do I get a Unix timestamp in milliseconds in MySQL?
Why does MySQL FROM_UNIXTIME return NULL?
Need a MySQL GUI Client?
1bench is a modern database client for MySQL and 20+ other databases. Query, browse, and manage your data visually.
Learn More