How to convert time zone in MySQL?

You can change the timezone in MySQL using php function CONVERT_TZ.

Following is the SQL command to change the timezone.

SELECT CONVERT_TZ( NOW(),'current-time-zone','changed-time-zone' );

If your current time zone is MST and you want to change the time zone to USA new york, you can fire the below command.

SELECT CONVERT_TZ( NOW(),'US/MST','America/New_York' );
  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to fix InnoDB database corruption error?

Check the log files. If you find InnoDB database corruption, follow the below mentioned steps:...

Fix - PHPMyAdmin Error You should upgrade to MySQL 5.5.0 or later

Problem statement Recently we upgraded phpMyAdmin version from 4.0.10.12 to 4.5.3.1 in our...

How to edit the my.cnf file of MySQL in Linux VPS?

Linux VPS and Dedicated server customers can edit MySQL configuration settings by modifying...

Fix :: Unable to login in phpMyadmin after revoking MySQL root user

Problem Statement I am not able to login into phpMyadmin after revoking root user. Solution...

How to connect MySQL using node js?

This article will show you how to connect to a MySQL database using the Node.js. Note: Node.js...