How to set Date and Time in Kali Linux?

In this module, we will see how to set date and time in Kali Linux. Time and date are set during installation of the operating system on hardware. If we skip the setting of time and date, during the installation of Kali Linux, then it may show different time and date.

Kali Linux is a Debian based Linux distribution geared for vulnerability and penetration testing. It is full of different types of pen-testing applications. Kali Linux is primarily used ethical hackers.

We can set any date and time or both using below methods:

  • Graphical User Interface (GUI) of Kali Linux
  • Command Line Interface (CLI), using some handy commands

Let’s go for each method one by one…

Using GUI method

On our Kali Linux, right click on time showing in corner of window with group of some other indicators (Connection, Speaker, Notifications, Power, Time etc…).

Group Of Indicators At Corner Of Window
Group of indicators at corner of window

Click on Properties option from drop-down menu.

Select Properties In Drop Down Menu
Select properties in drop down menu

Now, in the opened window, start typing your timezone in Timezone textbox. And matching timezone options will start appearing below. And select your timezone.

Select Your Time Zone
Select your timezone

After selecting our timezone. Current date and time got corrected on our Linux PC. After that, we can close this window.

After Updating Your Timezone Close This Window
After updating our timezone, close this window

After confirm the updated date and time.

Confirm The Latest Updated Time And Date After Choosing Our Timezone

Confirm the latest updated time and date after choosing our timezone

We can also select a custom Date and Time, let’s see how?

Setting custom Date and Time

To choose a custom date and time. Click on Date and Time Settings button in Clock window.

Click Date And Time Settings Button For Custom Date Time
Click on Time and Date Settings button for custom date and time

In the newly opened window, click on Unlock button before changing date or time. Otherwise, we will not able to change date or time.

Click Unlock Button To Change Date And Time 1
Click on Unlock button to change date and time

After that, it will ask for our password to authenticate. Authenticate with your password.

Authencate With Your Password
Authenticate with your password

After authentication, manual change date and time. After that, click on Lock button.

Click On Lock Button After Changing Time And Date
Click on Lock button after changing time and date

Now, we have successfully updated to our desired date and time in Kali Linux using GUI (Graphical User Interface).

Let’s see how to change date and time using CLI (Command Line Interface).

Using CLI method

Using Command Line, we change date and time by two commands.

  • timedatectl command
  • date command

Lets each command one by one.

timedatectl command

For synchronization date and time to our timezone using timedatectl command, use the following command.

sudo timedatectl set-timezone <our timezone>
Setting Timezone By Timedatectl Set Timezone Command
Setting timezone by timedatectl set-timezone command

We can also see list of timezones and choose accordingly list using below command.

timedatectl list-timezones
List Of Timezones
List of timezones

For setting custom date and time using timedatectl the command, follow the following syntax. And pass date, time or both in the format “YYYY-MM-DD HH:MM:SS”.

timedatectl set-time "YYYY-MM-DD HH:MM:SS"

To set only time, follow the command as below.

sudo timedatectl set-time HH:MM:SS

To set only date, follow the command as below.

sudo timedatectl set-time YYYY-MM-DD
Changing Date And Time Using Timedatectl Command
Changing date and time using timedatectl command

However, this can create problems as it may not synchronize with RTC (Real Time Clock), which is a hardware clock in our PC run by small battery and runs even PC is powered off to PC to synchronize with time.


date command

To set time, you can use the “-s” option with the date command in format “DD MM YYYY HH:MM:SS”. For example, to set date and time to March 15th 2021 15:25:47, we will use the following command.

sudo  date -s "15 Mar 2021 15:25:47"
Setting Date And Time To March 15th 2021 152547 Using Date Command
Setting date and time to March 15th 2021 15:25:47 using date command

Another example, to set date and time to Dec 17th 2025 11:57:12 with other format “MM DD HH:MM:SS YYYY”

sudo date -s "Dec 17 11:57:12 2025"
Setting Date And Time To Dec 17th 2025 115712 Using Date Command
Setting date and time to Dec 17th 2025 11:57:12 using date command

We have seen to change date or time or both using both timedatectl and date command. Now, you can change this on your PC without any hassle.

Conclusion

In this module, we discussed how to change date or time or both on Kali Linux. We used a Graphical User Interface to apply changes. We also saw Command Line to change these using timedatectl and date commands. Also, though, we used Kali Linux, but the same applies to other distributions.

Also Read