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 drop index and before dropping it how to get the DDL.

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

ORA-00257:archiver error, connect internal only until freed

Verifying Daemon “Avahi-Daemon” Not Configured And Running …FAILED (PRVG-1360)

Linux OL7/RHEL7: PRVE-0421 : No entry exists in /etc/fstab for mounting /dev/shm

SKIP DNS RESLOV.CONF CHECK DURING RAC CONFIGURATION

How to write to a CSV file using Oracle SQL*Plus

How to set up the Oracle Wallets in Oracle Database 19C

CPU Patch Analysis

How to troubleshoot Long Running Concurrent Request in EBS 12.2