Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hueman domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/CloudIngenium.com/htdocs/wp-includes/functions.php on line 6114
How to: Set the Timezone on Ubuntu Server – Knowledge eXchange

How to: Set the Timezone on Ubuntu Server

How to: Set the Timezone on Ubuntu Server

If you are using a VM hosted with a public cloud provider you probably have realized that they generally are deployed using UTC as the default timezone. In Windows I was very familiar modifying that but now that I have deployed an Ubuntu server I wasn’t sure where to begin. Every time I executed a php script on the terminal I got a warning that I should not rely on the server timezone (UTC) but set the right one on my php.ini file. I ended up doing that but I realized all the logs, etc are still based on the UTC timezone so I decided it was time to set my timezone on my Ubuntu server.

It turns out it is rather simple, just a few commands and considerations and you are set and done!

I. Verify the current settings and time using date (there is also a timezone file in /etc/timezone):

date
Wed Dec 10 04:10:03 UTC 2013

or as mentioned you should also check what is your current time zone (in my case, I was originally in UTC)

more /etc/timezone
Etc/UTC

II. To change the timezone you need to execute sudo dpkg-reconfigure tzdata. 

This will launch an interface for you to select the timezone from a number of options. If you have installed Ubuntu Server before it is the same screen as when you install your server. When you are done you´ll receive the following output on the terminal:

sudo dpkg-reconfigure tzdata

Current default time zone: ‘America/Mexico_City’
Local time is now: Tue Dec 09 22:12:45 CST 2013.
Universal Time is now: Wed Dec 10 04:12:45 UTC 2013.

as you can see this is rather simple.

III. Don’t forget to restart cron

Otherwise it won’t pick up the timezone change. If possible I recommend a whole server restart just to make sure everything picks up the change:

sudo service cron restart

Enhanced by Zemanta

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.