Check Time zone in MySQL

Check the time zone in MySQL

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

Check the data value in different time zone:

SELECT NOW();
SET global time_zone='Asia/Kolkata';
SELECT NOW();
SET time_zone = '+8:00';
SELECT NOW();

Example:

mysql> SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;
+--------------------+---------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone |
+--------------------+---------------------+
| +00:00             | SYSTEM              |
+--------------------+---------------------+

mysql> SET GLOBAL time_zone = '+8:00';

mysql> SET GLOBAL time_zone = '+8:00';
mysql> SET GLOBAL time_zone = 'Europe/Helsinki';

If you got error follow the following link:

mysql> SET GLOBAL time_zone = ‘US/Eastern’;
ERROR 1298 (HY000): Unknown or incorrect time zone: ‘US/Eastern’

ERROR 1298 (HY000): Unknown or incorrect time zone: ‘US/Eastern’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.