How to Set Date and Time on Linux

Change Time and Date on RHEL/CentOS and Fedora

This post shows how to set the time and date in the command line on RHEL/CentOS 8 and Fedora 30. The correct system time is essential for systems and creates the prerequisite for the proper functioning of many service. The command line tool timedatectl use to check and modify time setting.

Run the query using timedatectl without additional arguments:

To set-time switch along with the format of time in HH:MM:SS (Hour, Minute, and Seconds):

To set-time switch along with the format of date in YY:MM:DD (Year, Month, Day):

To set both date and time:

Find out if your hardware clock is set to local timezone:

Set your hardware clock to local timezone:

Leave a Reply

Your email address will not be published. Required fields are marked *