Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9008485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:56:53+00:00 2026-06-16T01:56:53+00:00

I need to change the timezone of a single database is this possible? I

  • 0

I need to change the timezone of a single database is this possible?

I know we can change the timezone within our WHM (we are using a dedicated server from hostgator), however a large number of legacy software running on the server has a lot of +6 hours coding in it (i.e. server timezone is CST, we wanted the time in GMT so previous developers altered date/times manually within the code – bad!).

I am now working on a new software and would like to have it all in GMT, I know I can use date_default_timezone_set(‘GMT’) however that will not solve MySQL inserts where the datetime column is set to CURRENT_TIMESTAMP as it will insert @ CST timezone.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:56:55+00:00Added an answer on June 16, 2026 at 1:56 am

    No, it’s not possible to change the timezone for a single database within a MySQL instance.

    We can retrieve the server and client time_zone settings with a query, like this:

    SELECT @@global.time_zone, @@session.time_zone;
    

    We can also change the client timezone for a session, or change the timezone for the entire MySQL instance.

    But we need to be keenly aware of the implication that this change will have on existing client connections, and the how DATETIME and TIMESTAMP values already stored in the instance will be interpreted.

    To have the server time_zone set at MySQL instance startup, we can modify the /etc/my.cnf file (or wherever the mysql instance initialization parameters are read from), under the [mysqld] section:

    [mysqld]
    default-time-zone='+00:00' 
    

    — or —

    It is also possible (less desirable) to add the --default_time_zone='+00:00' option to mysqld_safe

    NOTE: Changing the timezone setting on the MySQL server does NOT change the values stored in existing DATETIME or TIMESTAMP columns, BUT since it does effectively change the context in which those stored values are interpreted, it will look like all of the values ARE shifted. (Where 08:00 was taken to mean 8AM CST, with the time_zone of the server changed from CST to GMT, that same ’08:00′ will now be taken to be 8AM GMT, which would effectively be 2AM CST.

    Also keep in mind that TIMESTAMP columns are always stored in UTC, while DATETIME columns do not have a timezone.
    http://dev.mysql.com/doc/refman/5.5/en/datetime.html

    Each client session can change the timezone setting for their own session:

    SET time_zone='-06:00';
    

    But none of this really “solves” the timezone conversion problem, it just moves the conversion problem around.

    There’s nothing inherently “bad” with the application layer handling timezone conversions; sometimes, that’s the best place to handle. It just has to be done correctly and consistently.

    (What’s odd about the setup you describe is that the app is storing DATETIME values as if the MySQL server time_zone is set to GMT, but the MySQL server time_zone is set to something else.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to change table name from lowercase to uppercase but using this statement
I need to change this script so that I can click on my slideshow-expand
i need change color of SystemTray.ProgressIndicator color, how i can do it? I tried
I have database, and in one the tables I need change the values of
I have this situation: $(#button).toggle(function(){ $(#window).animate({top:'0%'},1000); },function(){ $(#window).animate({top:'-100%'},1000); }); but I need change it
i need to define a predefined language, it will be possible to change from
Can anyone advise how I change the timezone for my google app engine application?
I need change the background image, so I using: $('body').css({backgroundImage : 'url(images/wallpaper/'+wp+'.jpg)'}); But, I
I need change or remove <title> tag in wordpress using plugin for example <title>
I succeed to change the TimeZone and daylight time in Windows using SetTimeZoneInformation but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.