Description\n-----------\n\nMariaDB keeps track of several time zone settings.\n\nSetting the Time Zone\n\nThe time_zone system variable is the primary way to set the time zone. It can be specified in one of the following formats:\n\n The default value is SYSTEM, which indicates that the system time zone defined in the system_time_zone system variable will be used. Note that if you are using SYSTEM with replication in either statement or mixed mode, you MUST use the same value for system_time_zone on all slaves (otherwise TIMESTAMP columns will not replicate correctly). See System Time Zone below for more information.\n An offset from Coordinated Universal Time (UTC), such as +5:00 or -9:00, can also be used.\n If the time zone tables in the mysql database were loaded, then a named time zone, such as America/New_York, Africa/Johannesburg, or Europe/Helsinki, is also permissible. See mysql Time Zone Tables below for more information.\n\nThere are two time zone settings that can be set within MariaDB--the global server time zone, and the time zone for your current session. There is also a third time zone setting which may be relevant--the system time zone.\n\nGlobal Server Time Zone\n\nThe global server time zone can be changed at server startup by setting the --default-time-zone option either on the command-line or in a server option group in an option file. For example:\n\n``ini\n[mariadb]\n...\ndefault_time_zone = 'America/New_York'\n`\n\nThe global server time zone can also be changed dynamically by setting the time_zone system variable as a user account that has the SUPER privilege. For example:\n\n`sql\nSET GLOBAL time_zone = 'America/New_York';\n`\n\nThe current global server time zone can be viewed by looking at the global value of the time_zone system variable. For example:\n\n`sql\nSHOW GLOBAL VARIABLES LIKE 'time_zone';\n+---------------+--------+\n| Variable_name | Value  |\n+---------------+--------+\n| time_zone     | SYSTEM |\n+---------------+--------+\n`\n\nSession Time Zone\n\nEach session that connects to the server will also have its own time zone. This time zone is initially inherited from the global value of the time_zone system variable, which sets the session value of the same variable.\n\nA session's time zone can be changed dynamically by setting the time_zone system variable. For example:\n\n`sql\nSET time_zone = 'America/New_York';\n`\n\nThe current session time zone can be viewed by looking at the session value of the time_zone system variable. For example:\n\n`sql\nSHOW SESSION VARIABLES LIKE 'time_zone';\n+---------------+--------+\n| Variable_name | Value  |\n+---------------+--------+\n| time_zone     | SYSTEM |\n+---------------+--------+\n`\n\nSystem Time Zone\n\nThe system time zone is determined when the server starts, and it sets the value of the system_time_zone system variable. The system time zone is usually read from the operating system's environment. You can change the system time zone in several different ways, such as:\n\n If you are starting the server with mariadbd-safe, then you can set the system time zone with the --timezone option either on the command-line or in the \\[mariadbd-safe] option group in an option file. For example:\n\n`ini\n[mariadbd-safe]\ntimezone='America/New_York'\n`\n\n If you are using a Unix-like operating system, then you can set the system time zone by setting the TZ environment variable in your shell before starting the server. For example:\n\n`bash\n$ export TZ='America/New_York'\n$ service mariadb start\n`\n\n On some Linux operating systems, you can change the default time zone for the whole system by making the /etc/localtime symbolic link point to the desired time zone. For example:\n\n`bash\n$ sudo rm /etc/localtime\n$ sudo ln -s /usr/share/zoneinfo/America/New_York /etc/localtime\n`\n\n On some Debian-based Linux operating systems, you can change the default time zone for the whole system by executing the following:\n\n`bash\nsudo dpkg-reconfigure tzdata\n`\n\n On Linux operating systems that use systemd, you can change the default time zone for the whole system by using the timedatectl utility. For example:\n\n`bash\nsudo timedatectl set-timezone America/New_York\n``\n\nTime Zone Effects\n\nTime Zone Effects on Functions\n\nSome functions are affected by the time zone settings. These include:\n\n NOW()\n SYSDATE()\n CURDATE()\n CURTIME()\n UNIX_TIMESTAMP()\n\nSome functions are not affected. These include:\n\n UTC_DATE()\n UTC_TIME()\n UTC_TIMESTAMP()\n\nTime Zone Effects on Data Types\n\nSome data types are affected by the time zone settings.\n\n TIMESTAMP - See TIMESTAMP: Time Zones for information on how this data type is affected by time zones.\n DATETIME - See DATETIME: Time Zones for information on how this data type is affected by time zones.\n\nmysql Time Zone Tables\n\nThe mysql database contains a number of time zone tables:\n\n time_zone\n time_zone_leap_second\n time_zone_name\n time_zone_transition\n* time_zone_transition_type\n\nBy default, these time zone tables in the mysql database are created, but not populated.\n\nIf you are using a Unix-like operating system, then you can populate these tables using the mariadb-tzinfo-to-sql utility, which uses the zoneinfo data available on Linux, Mac OS X, FreeBSD and Solaris.\n\nIf you are using Windows, then you will need to import pre-populated time zone tables. These are available at MariaDB mirrors.\n\nTime zone data needs to be updated on occasion. When that happens, the time zone tables may need to be reloaded.\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/internationalization-and-localization/time-zones