How to permanently change the time in Ubuntu Server

8,945

Solution 1

Sounds like you have a timezone issue. The easiest way to fix this is to reconfigure the tzdata package sudo dpkg-reconfigure tzdata

There are alternative ways, like symlinking the correct zonefile from /usr/share/zoneinfo to /etc/localtime which will inform the system of the proper time:

ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime

However, it's preferred to use dpkg-reconfigure

Solution 2

If your timezone is set up correctly, I think you have to adjust your hardware clock with the command hwclock.

Share:
8,945
Luis Alvarado
Author by

Luis Alvarado

System Engineer Social Engineer Master in Pedagogy Master in Open Source CCNA Certified Linux Foundation Certified Former Askubuntu Moderator Stack Careers | Linkedin | Launchpad | Ubuntu Wiki - Random SE Stuff - Latin American Members | JC Race Award | Human Robot Award 74

Updated on September 18, 2022

Comments

  • Luis Alvarado
    Luis Alvarado over 1 year

    I have changed the time in Ubuntu Server 11.04 but when i reboot it resets to the default it has. How to change the time that when I boot it stays like i changed it. already tried date but I think this is only temporary.

    • Rinzwind
      Rinzwind almost 13 years
      date is permanent if you are not using a timeserver and the correct timezone ;)
    • Luis Alvarado
      Luis Alvarado almost 13 years
      @Marco - Thank you the problem was in the timezone. I did 'sudo dpkg-reconfigure tzdata', selected the correct place and done. Works perfect after reboot. If you can put it as an answer i will voted up.
    • Michael Gundlach
      Michael Gundlach almost 13 years
      Answer added!