How to Adjust the Date and Time in Linux – Guide

The “time” command in Linux is an operation timer and does not show the system time. Although unreasonable, the Linux “date” command displays the time, as well as the date, on a Linux box. You can set the date and time on the Linux system clock with the help of the “set” key in addition to the “date” command. Remember that simply changing the system clock does not reset the hardware clock. Synchronize the system clock with the hardware clock after adjusting date and time to preserve your settings when you exit and restart your computer.

How to change DATE and TIME on Linux

TIMEDATECTL Command

show date and time

/usr/bin/clock -u

sudo update-time This will update the system clock to the time you specified.

HH stands for hour, MM stands for minutes and SS stands for seconds.

Change of date

/usr/bin/date -d ‘yyyy-MM-dd’ This will change the system clock to the given date.

YYY is the year, MM is the month, DD is the day of the month. We also need to specify the time, otherwise it will be set to 00:00:00.

time zone change

UTC+00:00 This will find the time zone for the current system clock.

def time_zone(name, default_time_zone):

Set the time zone for the current working day.

default_time_zone = ‘UTC’

DATE command

show date and time

/usr/bin/clock -u

We can also customize the display date format using the following format: dd/mm/yyyy.

Change time

sudo update-time This will update the system clock to the time you specified.

UTC+00:00

Change of date

/usr/bin/date -d ‘yyyy-MM-dd’ This will change the system clock to the given date.

Date: yyyy-MM-dd

HWCLOCK command

show date and time

/usr/bin/clock

date and time change

/usr/bin/clock -h now

Synchronizing Date and Time

/usr/bin/clock -o systemclock

To synchronize the system clock with the hardware clock, you can use a hardware clock generator.

Final note

How to Adjust the Date and Time in Linux If you’re like most people, you probably use Linux to run your day-to-day activities. But sometimes you need to adjust the date and time so that your computer can work properly. This guide will show you how to do this in Linux. First, open a terminal window and type the following command: date This will give you a list of all of the current dates and times in your system. You can select one of these dates or times by using the arrow keys on your keyboard. The first time you run this command, it will ask for your date and time preferences. If you don’t have these preferences set up, then it will default to using the current date and time. The next step is to change the date and time in Linux. To do this, type the following command: date +%Y%m%d%H%M%S This will add one day (yyyy) at each hour (mm), minute (ss), second (ms), and tenths of a second (tsec). You can also use negative numbers if you want to add more days or hours than what is given by date . The %Y%m%d%H%M%S format is used because it’s similar to how we write years in English. For example, if I wanted to change my computer’s date from January 1st, 2009, to December 31st, 2009, I would type: date -y 1 Dec 2009