Fix Linux Time Reset After Reboot
If the time changes after restarting in a Linux system, you can follow these steps to resolve it:
- Check the clock settings: Run the timedatectl command to make sure the clock settings, including the time zone and time synchronization settings, are correct.
- Synchronize time: Make sure the system is synchronized with a network time server. You can enable Network Time Protocol (NTP) synchronization with the command sudo timedatectl set-ntp true.
- Manually set the time: If the time is still incorrect, you can manually set the time. Use the command sudo date -s “YYYY-MM-DD HH:MM:SS” to set the correct date and time.
- Check the hardware clock: If the issue persists, it may be due to a hardware clock problem. You can use the sudo hwclock –show command to check the hardware clock, and then use the sudo hwclock –set –date=”YYYY-MM-DD HH:MM:SS” command to manually set the hardware clock.
- Check BIOS settings: If the issue persists, it may be due to incorrect BIOS settings. You can enter the computer’s BIOS settings interface to verify if the clock settings are correct.
If none of the above methods work to solve the issue, it may be necessary to consider checking for hardware failures or other operating system-related problems. It is recommended to refer to relevant documents or seek help from professionals when facing such problems.