in Allgemein

MySql Timezones in the Cloud

On a small university project I found my self developing a web application with play, mysql and some javascript libraries. After testing and developing on my local machine I want to deploy my application.

Have heard of Openshift? It’s an amazing PaaS product by RedHat. It’s currently in Developer Preview and you can test it for free. To deploy it, follow  this amazing good tutorial.

What happend to my 24/7 chart?

The correct visualization

The correct visualization

The incorrect visualization

The incorrect visualization

Timezones

Openshift uses Amazones EC2 service. In particular the servers are located in the US-East region. But that should be too hard to change, or?

  1. Install PhpMyAdmin cartrige
  2. Log into your app with ssh and import time zone tables to mysql
    mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u admin -p mysql
  3. Login as admin in PhpMyAdmin
  4. Set global timezone with
    -- Set correct time zone
    SET GLOBAL time_zone = 'Europe/Berlin';
    -- check if time zone is correctly set
    SELECT version( ) , @@time_zone , @@system_time_zone , NOW( ) , UTC_TIMESTAMP( );

Happy timezone 🙂

Links