Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql, readme: update timezone support #617

Merged
merged 1 commit into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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