EpochTools
Database

Unix Timestamps in SQL

PostgreSQL, MySQL, SQLite, and BigQuery syntax.

Complete SQL Recipe

-- PostgreSQL:
SELECT EXTRACT(EPOCH FROM NOW())::BIGINT;               -- Current epoch
SELECT TO_TIMESTAMP(1710000000) AT TIME ZONE 'UTC';        -- Convert to UTC timestamp

-- MySQL:
SELECT UNIX_TIMESTAMP();                                -- Current epoch
SELECT FROM_UNIXTIME(1710000000);                          -- Convert to datetime

-- SQLite:
SELECT strftime('%s', 'now');                          -- Current epoch
SELECT datetime(1710000000, 'unixepoch');                  -- Convert to datetime

Test With Live Converter

Epoch → Human Date

Paste any Unix timestamp. The unit is auto-detected from its magnitude.

Auto-detects seconds, milliseconds, microseconds, or nanoseconds. Example: 1735689600

Detected:Auto (Seconds)

UTC ISO 8601

–

Local — auto

–

RFC 2822 / GMT

–

Seconds Value

–

Relative Time

–