content_image/758064.jpg content_image/758065.jpg
arithmetic for DATE , TIME , or DATETIME  values, convert them to UTC, perform the arithmetic, and then convert back. 

The current global and session time zone values can be retrieved like this: 

SELECT @@GLOBAL.time_zone, @@SESSION.time_zone; 

timezone  values can be given in several formats, none of which are case-sensitive: 

•As the value ’SYSTEM’ , indicating that the server time zone is the same as the system time zone. 

•As a string indicating an offset from UTC of the form [ H ] H : MM , prefixed with a +  or - , such as ’+10:00’ , ’-6:00’ , or ’+05:30’ . A leading zero can optionally be used for hours values less than 10; MySQL prepends a leading zero when storing and retriving the value in such cases. MySQL converts ’-00:00’  or ’-0:00’  to ’+00:00’ . 

Prior to MySQL 8.0.19, this value had to be in the range ’-12:59’  to ’+13:00’ , inclusive; beginning with MySQL 8.0.19, the permitted range is ’-13:59’  to ’+14:00’ , inclusive. 

•As a named time zone, such as ’Europe/Helsinki’ , ’US/Eastern’ , ’MET’ , or ’UTC’ . 

## Populating the Time Zone Tables 

<img src='content_image/758064.jpg'>

## Note 

Named time zones can be used only if the time zone information tables in the mysql  database have been created and populated. Otherwise, use of a named time zone results in an error: 

mysql> SET time_zone = ’UTC’; ERROR 1298 (HY000): Unknown or incorrect time zone: ’UTC’ 

Several tables in the mysql  system schema exist to store time zone information (see Section 5.3, “The mysql System Schema” ). The MySQL installation procedure creates the time zone tables, but does not load them. To do so manually, use the following instructions. 

<img src='content_image/758065.jpg'>

## Note 

Loading the time zone information is not necessarily a one-time operation because the information changes occasionally. When such changes occur, applications that use the old rules become out of date and you may find it necessary to reload the time zone tables to keep the information used by your MySQL server current. See Staying Current with Time Zone Changes. 

If your system has its own zoneinfo  database (the set of files describing time zones), use the mysql_tzinfo_to_sql  program to load the time zone tables. Examples of such systems are Linux, macOS, FreeBSD, and Solaris. One likely location for these files is the /usr/share/zoneinfo  directory. If your system has no zoneinfo database, you can use a downloadable package, as described later in this section. 

To load the time zone tables from the command line, pass the zoneinfo directory path name to mysql_tzinfo_to_sql  and send the output into the mysql  program. For example: 

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql 

The mysql  command shown here assumes that you connect to the server using an account such as root that has privileges for modifying tables in the mysql  system schema. Adjust the connection parameters as required. 

