How to Change System Date in Linux

To change the date of a Linux system, you can use the date command. Here are some common methods.

  1. – appointment
date MMDDhhmm[[CC]YY][.ss]

In this, MM represents month, DD represents date, hh represents hour, mm represents minute, CC represents century, YY represents the last two digits of the year, and ss represents second.

For example, to set the system date to October 15, 2021 at 12:30 pm.

date 101512302021
  1. appointment
  2. They instructed us to arrive at the meeting at 9:00 am sharp.
date -s "YYYY-MM-DD HH:MM:SS"

For example, to set the system date to October 15, 2021, at 12:30.

date -s "2021-10-15 12:30:00"
  1. can you tell me the current date and time?
timedatectl set-timezone [timezone]

For example, to set the system time zone to Asia/Shanghai:

timedatectl set-timezone Asia/Shanghai

It is important to note that modifying the system date and time requires root permission.

bannerAds