How to set Date and Time on a Linux Server

 

Linux Display Current Date and Time

Type the date command:
date
Sample outputs:

Tue Oct  4 13:11:27 IST 2022

Linux Display The Hardware Clock (RTC)

Type the following hwclock command to read the Hardware Clock and display the time on screen:
hwclock -rOR show it in Coordinated Universal time (UTC):
hwclock --show --utc

Linux Set Date Command Example


date --set="STRING"
For example, set new data to 2 Oct 2006 18:00:00, type the following command as root user:
date -s "4 OCT 2022 18:00:00"Type the following timedatectl command:
timedatectlsudo timedatectl set-time YYYY-MM-DD
For example set the current date to 2022-10-04 (4th, Oct, 2022):
timedatectl set-time '2022-10-04'
timedatectl

[root@shsdascn7i ~]# date -s "4 OCT 2022 13:12:00"

Tue Oct  4 13:12:00 IST 2022


Comments

Popular posts from this blog

How to fix Oracle SQL Developer connection issue "Got minus one from a read call"

How to drop index and before dropping it how to get the DDL.

How to troubleshoot Long Running Concurrent Request in EBS 12.2

How to autopopulate user_guid in fnd_user table ( EBS Blank Page)

Opatch is getting faild for GI patch with error code 2 while doing prereq

Few Important steps of Oracle Database Clone

How to Check AD and TXK code levels in your EBS environment

The Server is not able to service this request: [Socket:000445]Connection rejected, filter blocked Socket, weblogic.security.net.FilterException

CPU Patch Analysis

PRVG-11250 : The check "RPM Package Manager database" was not performed because