Epoch Converter for MySQL — FROM_UNIXTIME & UNIX_TIMESTAMP
Quick Answer: MySQL converts epoch to datetime with FROM_UNIXTIME(1704067200) and datetime to epoch with UNIX_TIMESTAMP("2024-01-01 00:00:00"). Results depend on the server timezone setting (@@global.time_zone).
Current Unix Epoch
1776009213
2026-04-12T15:53:33.000Z
FAQ
How do I store timestamps in MySQL?
Use the TIMESTAMP type for auto-UTC conversion, or DATETIME for storing the literal value. TIMESTAMP is limited to 2038; DATETIME supports up to 9999-12-31.
Does MySQL TIMESTAMP have a 2038 problem?
Yes. MySQL TIMESTAMP stores a 32-bit Unix timestamp, maxing out at 2038-01-19. Use DATETIME or BIGINT for dates beyond 2038.