If the time zone of your ApsaraDB RDS for MySQL instance differs from the time zone of the region where your workloads run, or you need to calibrate the standard time of your RDS instance in Daylight Saving Time (DST) scenarios, you can change the time zone in the ApsaraDB RDS console or by calling an API operation. This topic describes how to change the time zone of an RDS instance, how to verify the change, and provides a Time zones and UTC offsets table.
Scenarios
You must change the time zone of your RDS instance in the following scenarios:
The time zone of your RDS instance differs from the time zone of the region where your workloads run. For example, the default time zone of your RDS instance created before May 30, 2021 is SYSTEM, and you must change the time zone of the instance to match the time zone of the region where your workloads run.
Time changes between daylight saving time (DST) and winter time occur in the US, Canada, Australia, European countries, and other countries, requiring adjustment of the standard system time. For example, when the UK switches from winter time to daylight saving time, you need to change the winter time (UTC) to daylight saving time (
UTC+1
).
Prerequisites
You have created an RDS MySQL instance. For more information, see (Deprecated, redirected to "Step 1") Create an ApsaraDB RDS for MySQL instance.
Precautions
After changing the time zone parameter of an RDS instance, you must restart the instance for the modification to take effect. We recommend modifying parameters during off-peak hours and ensuring your application is configured to automatically reconnect to your RDS instance.
When the default_time_zone parameter of MySQL is set to SYSTEM, the following risks may exist:
Time inconsistency between the primary and secondary RDS instances
For high-performance local disk high availability instances, the time zones of the primary and secondary MySQL nodes may be inconsistent because the operating systems of the hosts where these nodes reside have different time zones. In extreme cases, this may affect data consistency.
Instance performance degradation
If your business frequently uses the
TIMESTAMP
field type, lock contention issues may occur due to time zone conversion, resulting in instance performance fluctuations.Inconsistent interpretation of CST time zone between JDBC and MySQL
The CST time zone has multiple meanings: MySQL interprets it as
UTC+08:00
China Standard Time by default, while some JDBC versions (such as 8.0.22/23) interpret it asUTC - 6
Central Standard Time (US). When the operating system time zone is CST, data read from or written to MySQL by JDBC may not meet expectations. Typical case: The time zone CST has different meanings on MySQL Server and on conntector/j.
Change the time zone of an RDS instance in the ApsaraDB RDS console
Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
In the left-side navigation pane, click Parameters.
On the Editable Parameters tab, find the default_time_zone parameter, click Runtime Parameter Values
in the column, modify the time zone value in the dialog box that appears, and then click OK.
NoteFor the values of the default_time_zone parameter, see Time zones and UTC offsets.
Click Apply Changes, select a time period for the changes to take effect in the dialog box that appears, and then click OK.
NoteIf you want to cancel the parameter modification before submitting it, click Cancel.
Change the time zone of an RDS instance by calling an API operation
Sample request
This example calls the ModifyParameter operation to change the default_time_zone parameter to +9:00.
...
// Parameter settings for API request
ModifyParameterRequest modifyParameterRequest = ModifyParameterRequest.builder()
.DBInstanceId("rm-bp1l94k5sw1zxxxxx")
.parameters("{"default_time_zone":"+9:00"}")
.forcerestart(true)
// Request-level configuration rewrite, can set Http request parameters, etc.
// .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
.build();
...
JSON
format response
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId": "6D698793-FC2B-5FC1-A6DF-33EDAD1AD6AB"
}
Check whether the time zone of an RDS instance is changed
Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
In the left-side navigation pane, click Parameters.
On the Parameter Change History tab, check whether the modified time zone parameter value has taken effect.
Time zones and UTC offsets
Time zone | Standard time offset | Remarks |
Afghanistan Standard Time | (UTC+04:30) | Kabul |
Alaskan Standard Time | (UTC-09:00) | Alaska |
Arabian Standard Time | (UTC+04:00) | Abu Dhabi, Muscat |
Atlantic Standard Time | (UTC-04:00) | Atlantic Time (Canada) |
AUS Central Standard Time | (UTC+09:30) | Darwin |
AUS Eastern Standard Time | (UTC+10:00) | Canberra, Melbourne, Sydney |
Belarus Standard Time | (UTC+03:00) | Minsk |
Canada Central Standard Time | (UTC-06:00) | Saskatchewan |
Cape Verde Standard Time | (UTC-01:00) | Cabo Verde Is. |
Cen. Australia Standard Time | (UTC+09:30) | Adelaide |
Central America Standard Time | (UTC-06:00) | Central America |
Central Asia Standard Time | (UTC+06:00) | Astana |
Central Brazilian Standard Time | (UTC-04:00) | Cuiaba |
Central Europe Standard Time | (UTC+01:00) | Belgrade, Bratislava, Budapest, Ljubljana, Prague |
Central European Standard Time | (UTC+01:00) | Sarajevo, Skopje, Warsaw, Zagreb |
Central Pacific Standard Time | (UTC+11:00) | Solomon Islands, New Caledonia |
Central Standard Time | (UTC-06:00) | Central Time (US and Canada) |
Central Standard Time (Mexico) | (UTC-06:00) | Guadalajara, Mexico City, Monterrey |
China Standard Time | (UTC+08:00) | Beijing, Chongqing, Hong Kong, Urumqi |
E. Africa Standard Time | (UTC+03:00) | Nairobi |
E. Australia Standard Time | (UTC+10:00) | Brisbane |
E. Europe Standard Time | (UTC+02:00) | Chisinau |
E. South America Standard Time | (UTC-03:00) | Brasilia |
Eastern Standard Time | (UTC-05:00) | Eastern Time (US and Canada) |
Georgian Standard Time | (UTC+04:00) | Tbilisi |
GMT Standard Time | (UTC) | Dublin, Edinburgh, Lisbon, London |
Greenland Standard Time | (UTC-03:00) | Greenland |
Greenwich Standard Time | (UTC) | Monrovia, Reykjavik |
GTB Standard Time | (UTC+02:00) | Athens, Bucharest |
Hawaiian Standard Time | (UTC-10:00) | Hawaii |
India Standard Time | (UTC+05:30) | Chennai, Kolkata, Mumbai, New Delhi |
Jordan Standard Time | (UTC+02:00) | Amman |
Korea Standard Time | (UTC+09:00) | Seoul |
Middle East Standard Time | (UTC+02:00) | Beirut |
Mountain Standard Time | (UTC-07:00) | Mountain Time (US and Canada) |
Mountain Standard Time (Mexico) | (UTC-07:00) | Chihuahua, La Paz, Mazatlan |
US Mountain Standard Time | (UTC-07:00) | Arizona |
New Zealand Standard Time | (UTC+12:00) | Auckland, Wellington |
Newfoundland Standard Time | (UTC-03:30) | Newfoundland |
Pacific SA Standard Time | (UTC-03:00) | Santiago |
Pacific Standard Time | (UTC-08:00) | Pacific Time (US and Canada) |
Pacific Standard Time (Mexico) | (UTC-08:00) | Baja California |
Russia Standard Time | (UTC+03:00) | Moscow, St. Petersburg, Volgograd |
SA Pacific Standard Time | (UTC-05:00) | Bogota, Lima, Quito, Rio Branco |
SE Asia Standard Time | (UTC+07:00) | Bangkok, Hanoi, Jakarta |
China Standard Time | (UTC+08:00) | Kuala Lumpur, Singapore |
Tokyo Standard Time | (UTC+09:00) | Osaka, Sapporo, Tokyo |
US Eastern Standard Time | (UTC-05:00) | Indiana (East) |
UTC | UTC | Coordinated Universal Time |
UTC-02 | (UTC-02:00) | Coordinated Universal Time-02 |
UTC-08 | (UTC-08:00) | Coordinated Universal Time-08 |
UTC-09 | (UTC-09:00) | Coordinated Universal Time-09 |
UTC-11 | (UTC-11:00) | Coordinated Universal Time-11 |
UTC+12 | (UTC+12:00) | Coordinated Universal Time+12 |
W. Australia Standard Time | (UTC+08:00) | Perth |
W. Central Africa Standard Time | (UTC+01:00) | West Central Africa |
W. Europe Standard Time | (UTC+01:00) | Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna |
Kathmandu Time | (UTC+5:45) | Kathmandu |
Myanmar Time | (UTC+6:30) | Rangoon, Nay Pyi Taw |
Uzbekistan Time | (UTC+5) | Lahore, Karachi, Islamabad |
Samoa Western Standard Time | (UTC+13) | Nuku Alofa, Appiah |
UTC-12 | (UTC-12) | Coordinated Universal Time-12 |
Related API operations
API operation | Description |
When changing the time zone, you can modify the time zone parameter default_time_zone. |