How to change system date & time in Linux [Tip]

This guide will walk you through on how to change system date and time in Linux. As we know Linux is an OS like Windows and Macintosh. It is quite secured and robust as compared to windows that is why it is widely used in large servers and by big companies to handle date more securely and easily.

Linux has graphical user interface GUI but it can be operated using terminal giving specific commands for specific operations. In our topic, we will be using terminal for changing date and time purpose which is available on Linux OS as a built-in program.linuxlogo

Basic Commands

For changing time in a Linux we usually use time command. Time command in Linux is timer which usually do not preview the system time. On the other hand the Linux Date command shows the time with the date in Linux box. For setting the date and time on Linux system clock we use the set along with Date command. But it must be noted that we cannot change the hardware clock by simply changing the system clock.

For that purpose, we have to sync the Linux system clock with the internal hardware clock once we set the time and date to keep the required settings.so that it will not come back to previous  once we log off, shutdown or restart the computer.

We adopt following steps to make it happen.

Step 1

First we open command terminal in Linux window which is just like command prompt in windows. It is installed in Linux like Ubuntu which is a graphical Linux interface.linuxterminal

Step 2

Once it is opened we type a specifically written command by Linux designers which automatically changes the time, date and time zone with the time, date and time zone you intend to set after pressing enter. The above discussed command is as follow. You have to enter it in the terminal of Linux to take effect

                             date –set=Wed Jan 28 12:05:15 CST 2014

Step 3

By following step 2 we have just changed the system clock now it is time to reset hardware clock and sync the both. Sync the hardware clock with Linux system clock by typing command at the prompt in Linux terminal.

                              hwclock –systohc

If you have followed the mentioned steps carefully then your Linux time and date will be changed to the required value.

Not Using Ubuntu? No problem!

We have lots of Linux based OS available in the market. If you are not an Ubuntu user and using other provider then the basically command line is very same in those platforms too. For example

  • If you are using Red Hat, you will use following command to set the date and time.

                                     dateconfig

  • If you are running Knoppix or freebsd, the basic syntax is same. For example use the date command followed by the month, day, hour, minute and year with every single typed in numbers and without any spaces.

For example, type the following command in the terminal to set the system date to January 12, 2016 and the time to 14:25 (2:25 PM):

                                   date 011214252016

Related Posts