- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change MySQL timezone?
To change the timezone in MySQL, we can use the SET command. The following is the syntax.
SET time_zone=’someValue’;
Let us now use the above syntax and apply it in the below query.
mysql > SET time_zone = '+8:00'; Query OK, 0 rows affected (0.00 sec)
Above, the time_zone is changed by a value equivalent to 8. To change the timezone globally, use the GLOBAL command. Here is the syntax.
SET GLOBAL time_zone = 'someValue';
Here is an example.
mysql> SET GLOBAL time_zone = '+8:00'; Query OK, 0 rows affected (0.00 sec)
The above query will change the timezone globally.
Advertisements
To Continue Learning Please Login
Login with Google