From d68124cf208b07aba2515b1bcf46adcee8f29e3f Mon Sep 17 00:00:00 2001 From: lilin90 Date: Wed, 12 Sep 2018 15:23:01 +0800 Subject: [PATCH] sql, readme: update timezone support Via: https://github.com/pingcap/docs-cn/pull/876 --- README.md | 2 +- sql/time-zone.md | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) 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: