diff --git a/README.md b/README.md index 5a027b2277871..7cbf8cd90a40c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ + Globalization - [Character Set Support](sql/character-set-support.md) - [Character Set Configuration](sql/character-set-configuration.md) - - [Time Zone](sql/time-zone.md) + - [Time Zone Support](sql/time-zone.md) + Data Types - [Numeric Types](sql/datatype.md#numeric-types) - [Date and Time Types](sql/datatype.md#date-and-time-types) diff --git a/sql/time-zone.md b/sql/time-zone.md index baa83244a9672..0c6fa8709c912 100644 --- a/sql/time-zone.md +++ b/sql/time-zone.md @@ -1,12 +1,16 @@ --- -title: Time Zone +title: Time Zone Support summary: Learn how to set the time zone and its format. category: user guide --- -# Time Zone +# Time Zone Support -The time zone in TiDB is decided by the global `time_zone` system variable and the session `time_zone` system variable. The initial value for `time_zone` is 'SYSTEM', which indicates that the server time zone is the same as the system time zone. +The time zone in TiDB is decided by the global `time_zone` system variable and the session `time_zone` system variable. The default value of `time_zone` is `SYSTEM`. The actual time zone corresponding to `System` is configured when the TiDB cluster bootstrap is initialized. The detailed logic is as follows: + +- Prioritize the use of the `TZ` environment variable. +- If the `TZ` environment variable fails, extract the time zone from the actual soft link address of `/etc/localtime`. +- If both of the above methods fail, use `UTC` as the system time zone. You can use the following statement to set the global server `time_zone` value at runtime: