All Products
Search
Document Center

ApsaraDB RDS:Modify the ApsaraDB RDS for PostgreSQL time zone

Last Updated:Jun 20, 2026

Modify the time zone of your ApsaraDB RDS for PostgreSQL instance if the current setting does not meet your business requirements or if your application handles data across multiple time zones. This ensures that data is correctly converted and displayed across different time zones.

Prerequisites

You have an ApsaraDB RDS for PostgreSQL instance that uses cloud disks.

Usage notes

  • The SET timezone statement applies only to the current session and is not persistent. To make the change permanent, modify the parameter as described in Set instance parameters.

  • To set a time zone for a specific database, run this statement: ALTER DATABASE <database_name> SET timezone TO '<time_zone_name>';.

    Note

    To reset the time zone of a database to the system default, run this statement: ALTER DATABASE <database_name> SET timezone TO DEFAULT;.

  • PostgreSQL supports two data types for storing timestamps: TIMESTAMP and TIMESTAMPTZ. Choose the appropriate data type based on your business requirements:

    • TIMESTAMP: This data type stores date and time values in UTC but does not store time zone information. If you modify the time zone as described in this topic, query results for this data type remain unchanged.

    • TIMESTAMPTZ: This data type is time zone-aware. When you store a timestamp, PostgreSQL converts it to UTC for storage. When you retrieve the data, PostgreSQL converts it from UTC to the time zone set for the instance or session. If you modify the time zone as described in this topic, query results for this data type automatically reflect the new time zone.

Modify the time zone

For an ApsaraDB RDS for PostgreSQL instance that uses cloud disks, go to the Parameters page in the console to modify the timezone parameter. For detailed instructions, see Set instance parameters.

The default value of the timezone parameter is Asia/Shanghai. Modifying this parameter does not require an instance restart.

Note

ApsaraDB RDS for PostgreSQL instances that use Premium Local SSD do not support the timezone parameter.

View supported time zones

To view all supported time zones, run this command:

SELECT name,utc_offset FROM pg_timezone_names;
Note

For more information about the pg_timezone_names table, see pg_timezone_names.

Related documents