# Modify of the Time Zone

__*Modifying the TiDB time zone*__
__*time_zone*__

![left](./student-guide/diagram/ModifyingTimeZone_en_001_20220627.png)
-------------------------------------------------------------
The time zone used by TiDB is System by default for time*The zone global variable and the session variable are determined. time*zone. The actual time zone corresponding to System is set when the TiDB cluster bootstrap is initialized. The specific logic is as follows:
- Prioritize TZ environment variables
- If it fails, extract from the actual softchain address in /etc/localtime.
- If neither of the above fails, UTC is used as the system time zone.

You can modify the global time zone during runtime:
SET GLOBAL time_zone = timezone;

TiDB can also set the value of the session variable time*zone maintains a separate time zone for each connection. By default, this value takes the global variable time*zone. modify the time zone used by the session:
SET time_zone = timezone;

To view the values for the timezone currently in use:
SELECT @ @global .time*zone, @ @session .time*zone;

Set the format of the time_zone value:
- 'SYSTEM' indicates use of system time
- offset from UTC time, such as '+ 10:00 'or '- 6:00'
- The name of a time zone, such as' Europe/Helsinki ',' US/Eastern ', or' MET '

The return value of NOW () and CURTIME () is affected by the time zone setting.

Note:
Only values of the Timestamp data type are time-zone-sensitive. It can be understood that the actual representation of the Timestamp data type is (literal value+time zone information). Other time and date types, such as Datetime/Date/Time, do not contain time zone information and are therefore not affected by time zone changes.

Reference information: https://docs.pingcap.com/zh/tidb/stable/configure-time-zone