How to change the system date?

0201

To change the system date in Linux, you can use the date command with superuser privileges. Here’s how to do it:

  1. Open the Terminal.

  2. Use the date command with the desired format. The general syntax is:

    sudo date MMDDhhmm[[CC]YY][.ss]
    
    • MM is the month (01-12)
    • DD is the day (01-31)
    • hh is the hour (00-23)
    • mm is the minute (00-59)
    • CC is the first two digits of the year (optional)
    • YY is the last two digits of the year (optional)
    • ss is the seconds (optional)
  3. Example: To set the date to August 2, 2024, at 10:30 AM, you would run:

    sudo date 080210302024
    
  4. Verify the Change: After changing the date, you can verify it by running:

    date
    

Note: Changing the system date may require administrative privileges, and it's important to ensure that the new date is correct to avoid issues with scheduled tasks and logging.

0 Comments

no data
Be the first to share your comment!