Change the time zone and time on the server

Change time zone

In most cases, the server and monitored computers should be set to work in the same time and the same time zone.

Time and time zone are set in the process of OS installation

In case you need to change the time zone on an already running system:

sudo dpkg-reconfigure tzdata

Then choose your region and city.

../_images/faq_timezone_1.png ../_images/faq_timezone_2.png

Change time

To set the current time use the command:

sudo date +%T -s "11:14:00"

To set the current date run:

sudo date +%Y%m%d -s "20120418"

Note

Keep in mind that time and time zone are two different things.

Change the figures to your time value.

DayMonthHourMinuteYear where a two-digit number is allocated to each value, and only a year - a four-digit one.

Automatic time synchronization

You can use automatic time synchronization with NTPD and the guide for the time synchronization daemon for Ubuntu Server.