How to change the database time zone in phpMyAdmin

How to change the database time zone in phpMyAdmin

During the development or lifecycle of your online project, you may need to adjust the time zone of web applications to ensure that dates and times are handled correctly. In this guide, we show how to change the time zone of a database from phpMyAdmin.
 
The default time zone for databases of a hosting created in cdmon is CEST or CET.
 
-          CET (Central European Time): From the end of October until the end of March.
-          CEST (Central European Summer Time): From the end of March until the end of October.
 
To modify the time zone of a database, it is essential to first access phpMyAdmin from your hosting management: How to access phpMyAdmin
 
There may be multiple databases in your hosting account. It is crucial to identify and select the database associated with the specific website or project you want to adjust.
 
 
Once inside phpMyAdmin and after selecting the appropriate database, you must go to the “SQL” tab where you can execute SQL commands directly.
 
Check the current time zone
To know which time zone is currently configured, run the following command:
 
SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;
 
 
If no changes have been made previously, the result of this command will be “SYSTEM”, which means that the time zone configured on the server is being used, as explained at the beginning of this guide. This command is useful to confirm the time zone before making any changes.


Change the time zone
To adjust the time zone to a new one, use the command:
 
set time_zone='<TimezoneName>';
 
Replace <TimezoneName> with the desired time zone according to the IANA time zone format. In this link you can check the list of available TZ identifiers.
For example, to change the time zone to U.S. Eastern Standard Time, you would use:
 
SET time_zone = 'America/New_York';
 
After entering the command, click "Continue" and phpMyAdmin should confirm that the change has been successfully applied.
 
 
After modifying the time zone settings, it is crucial to perform tests to ensure that everything works as expected, especially in applications sensitive to time changes such as calendar plugins or event management.
 
Reset to the system time zone
If you need to revert the changes and use the server’s time zone again, simply run:
 
SET time_zone = 'SYSTEM';
 
 
For more information, you can contact us.
    • Related Articles

    • How to change the check of a database from phpMyAdmin

      The collation of a database is a crucial aspect to ensure that data is stored efficiently and accurately. In this article, we will show you how to change the collation of a database using phpMyAdmin. Before showing the steps to make this change, it ...
    • How to change the time from the wordpress manager

      In this guide, we show the steps to change the time zone assigned to your WordPress: Log in to the WordPress admin panel: The first thing you need to do is log in to the WordPress admin panel using your administrator credentials. Access the General ...
    • How to change the Wordpress administrator password from the database

      The access credentials to the WordPress administrator are stored in the database assigned to it, so it is possible to modify them by following several steps: First of all, we must access phpMyAdmin from our control panel to manage the WordPress ...
    • How to set up the database in Prestashop

      PrestaShop is a popular e-commerce platform that allows you to create and manage your online stores effectively. A fundamental part of PrestaShop configuration is the correct database setup. The database stores critical information about products, ...
    • How to import and export databases from phpMyAdmin

      From phpMyAdmin you can manage your databases, add, delete, or create new content. Two of the most common operations when using phpMyAdmin are importing and exporting databases. First access phpMyAdmin (application used to manage databases) using the ...