TIMESTAMP WITH TIME ZONE - PostgreSQL to MySQL Migration

In PostgreSQL, the TIMESTAMP WITH TIME ZONE data type stores datetime with time zone information.

MySQL does not provide a data type for storing values with different time zones. You can use the DATETIME data type and convert PostgreSQL values to UTC (or any other single time zone) so that all values are stored consistently in the same time zone.

PostgreSQL:

  -- Sample table
  CREATE TABLE products
  (
     name VARCHAR(30),
     created TIMESTAMP WITH TIME ZONE
  );
 
  INSERT INTO products VALUES ('Apple', '2003-07-24 10:23:54 -8:00');
  INSERT INTO products VALUES ('Milk',   '2025-10-22 15:28:27 +03');

When you transfer the existing data with time zone information from PostgreSQL to MySQL, you can use the AT TIME ZONE clause in PostgreSQL to get all timestamps in the UTC time zone:

PostgreSQL:

  -- Convert timestamps to UTC on transfer
  SELECT name, created AT TIME ZONE 'UTC' FROM products;

Result:

name product
Apple 2003-07-24 18:23:54
Milk 2025-10-22 12:28:27

Note. SQLines Data tool converts TIMESTAMP WITH TIME ZONE data to the UTC time zone when migrating to MySQL automatically.

For more information, see PostgreSQL to MySQL Migration Reference.