Skip to content

Commit

Permalink
sql, readme: update timezone support
Browse files Browse the repository at this point in the history
  • Loading branch information
lilin90 committed Sep 12, 2018
1 parent 47d9b74 commit d68124c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions sql/time-zone.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down

0 comments on commit d68124c

Please sign in to comment.