SwapSQL

PostgreSQL → MySQL

Convert PostgreSQL timestamptz to MySQL

MySQL DATETIME stores no time zone, so timezone-aware values must be normalized. The safe convention: convert everything to UTC during migration.

timestamptz DATETIME(6)

What to know

Before / after

PostgreSQL

joined timestamptz DEFAULT now()
-- value: 2024-05-01 10:00:00+04

MySQL

joined DATETIME(6) DEFAULT CURRENT_TIMESTAMP(6)
-- value: 2024-05-01 06:00:00.000000 (UTC)

Don't convert column-by-column — convert the whole database.

Upload a dump, get back ready-to-import SQL with this mapping (and every other one) applied.

Open the PostgreSQL → MySQL converter

See the full type mapping table or all guides.