Keeping the correct date and time on your Ubuntu system is essential for various applications, logging, and system functionalities. This guide provides step-by-step instructions for changing the system date and time in Ubuntu using both command line and graphical methods.
Method 1: Using the Command Line
Step 1: Open Terminal
Press Ctrl + Alt + T
to open the terminal window.
Step 2: Check Current Date and Time
To view the current date, time, and timezone settings, run:
timedatectl
Step 3: Set the Date and Time
To change the date and time, use the following command:
sudo timedatectl set-time 'YYYY-MM-DD HH:MM:SS'
For example, to set the date to April 7, 2025, at 11:20:15 AM, you would run:
sudo timedatectl set-time '2025-04-07 11:20:15'
Step 4: Set Timezone
To change the timezone, first, list available timezones:
timedatectl list-timezones
Find your desired timezone (e.g., America/New_York
), and then set it using:
sudo timedatectl set-timezone 'America/New_York'
Step 5: Enable NTP Synchronization (optional)
To keep your system clock synchronized with internet time servers, enable NTP (Network Time Protocol):
sudo timedatectl set-ntp on
Method 2: Using the Graphical Interface
Step 1: Open Settings
Click on the system menu in the top-right corner and select Settings.
Step 2: Navigate to Date & Time
In the Settings window, find and click on the Date & Time tab.
Step 3: Turn Off Automatic Time Zone
If enabled, turn off Automatic Time Zone to manually set your timezone.
Step 4: Set Date and Time
- Click on Time Zone to select your desired timezone from a map or dropdown menu.
- Adjust the date and time fields as needed.
Step 5: Enable Automatic Date & Time (optional)
If you want your system to automatically synchronize with internet time servers, turn on Automatic Date & Time.
Conclusion
These methods allow you to effectively change the system date and time in Ubuntu, whether through the command line or the graphical interface. Choose whichever method suits your preference for managing time on your system!
For more tips and guides on Ubuntu, check out other articles on CodeAllow.