How to Change Date and Time on RHEL 6

Share this Article :

This post assumed that your Red Hat Enterprise Linux 6 (RHEL 6) does not have Date/Time Properties installed. In order to change the date and time you will have to perform the changes from the command line. Note that in order to perform actions described in this post, you have to be logged in as a root:

1. Change the current date with the following form :

[[email protected] ~]# date +%D -s YYYY-MM-DD

Note : YYYY with a four-digit year, MM with a two-digit month, and DD with a two-digit day of the month.
Example :

[[email protected] ~]# date +%D -s 2012-05-30

2. Change the current time with the following form :

[[email protected] ~]# date +%T -s HH:MM:SS

If your system clock is set to use UTC (Coordinated Universal Time), add the following option :

[[email protected] ~]# date +%T -s HH:MM:SS -u

Note : HH stands for an hour, MM is a minute, and SS is a second

Example :

[[email protected] ~]# date +%T -s 22:30:00


[[email protected] ~]# date +%T -s 22:30:00 -u

3. How to Display current date and time :

[[email protected] ~]# date
Wed May 30 22:30:04 MYT 2012

Leave a Reply