Step 1
It's easy to change time in rhel 7. We can check the date and time with below command.
date
If we want to know all the details like timezone, date, time and etc... run the below command.
timedatectl
it will show like below
Step 2
To set time use the following command
timedatectl set-time 15:22:34
if some times it will show the error like below
Failed to set time: Automatic time synchronization is enabled
then we need to disable the automatic time sync with following command
timedatectl set-ntp 0
after change date and time then again enable it if needed with following command.
timedatectl set-ntp 1
If we need to change time and date along then following command will help us.
timedatectl set-time "2017-06-19 15:28:40"
Step 3
If we want to change the timezone then follow the command
timedatectl set-timezone America/New-York
if you don't know correct name of time zone then search it with following command and you can add.
timedatectl list-timezone | grep -i york
if you want to list all the timezone then follow the command
timedatectl list-timezone
Step 4
To display the current year format
date +"%Y"
To display the current month format
date +"%m"
To display current year and month and year
date +"%m-%d-%Y"
Thanks it's for my study purpose only if you see any mistakes please command and make me perfect.
It's easy to change time in rhel 7. We can check the date and time with below command.
date
If we want to know all the details like timezone, date, time and etc... run the below command.
timedatectl
it will show like below
Step 2
To set time use the following command
timedatectl set-time 15:22:34
if some times it will show the error like below
Failed to set time: Automatic time synchronization is enabled
then we need to disable the automatic time sync with following command
timedatectl set-ntp 0
after change date and time then again enable it if needed with following command.
timedatectl set-ntp 1
If we need to change time and date along then following command will help us.
timedatectl set-time "2017-06-19 15:28:40"
Step 3
If we want to change the timezone then follow the command
timedatectl set-timezone America/New-York
if you don't know correct name of time zone then search it with following command and you can add.
timedatectl list-timezone | grep -i york
if you want to list all the timezone then follow the command
timedatectl list-timezone
Step 4
To display the current year format
date +"%Y"
To display the current month format
date +"%m"
To display current year and month and year
date +"%m-%d-%Y"
Thanks it's for my study purpose only if you see any mistakes please command and make me perfect.
You have performed a great job on this article. It’s very precise and highly qualitative. You have even managed to make it readable and easy to read. You have some real writing talent. Thank you so much. replica diploma
ReplyDeleteThank you very much
Delete