Step 1: Check Current Date and Time
Step 2: Set Date and Time Manually
Step 3: Synchronize Time with NTP Server
Step 4: Set Timezone

In Linux systems like CentOS and Fedora, correctly setting the system date and time is crucial for logging, scheduling, and security purposes. This guide will walk you through the steps to view and configure the system clock.

Step 1: Check Current Date and Time

To view the current system date and time, use:

date

Step 2: Set Date and Time Manually

You can set the date and time manually using the date command. The format is:
sudo date MMDDhhmmYYYY.ss


Where:

  • MM = month (01-12)

  • DD = day (01-31)

  • hh = hour (00-23)

  • mm = minutes (00-59)

  • YYYY = year (e.g., 2024)

  • ss = seconds (00-59)

Example:
To set the date to August 2, 2025, 16:30:00, run:

 sudo date 080216302025.00

Step 3: Synchronize Time with NTP Server

To keep your system time accurate, use chrony or ntpd service to sync with Network Time Protocol (NTP) servers.

Using chrony:

  1. Install chrony (if not installed):

sudo yum install chrony

  1. Start and enable the chrony service:

    sudo systemctl start chronyd
    sudo systemctl enable chronyd

    1. Check synchronization status:

    chronyc tracking

Step 4: Set Timezone

To set or change the system timezone, use the timedatectl command.

  1. List available timezones:

timedatectl list-timezones
 
  1. Set your timezone (e.g., Europe/Istanbul):

sudo timedatectl set-timezone Europe/Istanbul
  1. Verify the current timezone:

timedatectl

By following these steps, you can accurately configure the date, time, and timezone on your CentOS or Fedora system, ensuring your server operates correctly and logs events with the correct timestamps.

#Linux #CentOS #Fedora #DateTime #TimeSetting #NTP #chrony #SystemAdministration #ServerManagement #TimeZone

 


 
Faydalı Buldunuz mu?
(47 defa görüntülendi. / 0 kişi faydalı buldu.)