Ralph

How To: Set the Timezone on Ubuntu (Server)

Introduction

user

Ralph

Ralph is a car enthusiast, blogger, author and teacher. In addition to being the founder of this website, Ralph is also a Linux Systems Administrator with 9 years+ experience who is also available for freelance or full-time work.


LATEST POSTS

The whole system that we live in drills into us… 23rd September, 2018

Canvas LMS: Install QTI Migration Tool 08th August, 2017

General

How To: Set the Timezone on Ubuntu (Server)

Posted on .

Like most server administrators, I find myself needing to analyse server logs for some reason. It’s pretty annoying when you view log files in an attempt to make sense of your data only to find the time-stamps on events don’t correspond to your local time.

To check your time-zone, use “date”:

root@n3rve:~# date
Mon Feb  2 16:29:07 WAT 2015

You can also check the time-zone by viewing the content of /etc/timezone

root@n3rve:~# cat /etc/timezone
Africa/Lagos

To change the time/timezone, we use the dpkg-reconfigure command:

root@n3rve:~# dpkg-reconfigure tzdata

Use the arrow keys to highlight your preferred timezone, press TAB and ENTER. Highlight and select your City/Region. You will get a confirmation acknowledging the update:

Current default time zone: 'Africa/Lagos'
Local time is now: Mon Feb  2 16:25:53 WAT 2015.
Universal time is now: Mon Feb  2 16:25:53 UTC 2015.

You may need to prepend those commands with ‘sudo’, assuming you’re not logged in as root. I suggest rebooting the system after making the change too. I hope that resolves it for you. If you have any contributions, let’s hear you in the comments.

profile

Ralph

Ralph is a car enthusiast, blogger, author and teacher. In addition to being the founder of this website, Ralph is also a Linux Systems Administrator with 9 years+ experience who is also available for freelance or full-time work.

Navigation