Skip to main content
2 of 2
adding information
devnull
  • 5.5k
  • 24
  • 36

If you don't wish to use the NTP command, see if this works as an alternative for you:

date -s "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g') -0500"

**Note: The time pulled from Google, is in GMT, so the -0500 represents the numeric timezone you are in. For me I am in US/EST so that is -0500, please change yours to match to your respective timezone, and it should fix any 'local time offsets' you might be experiencing.

If it isn't sticking every time you log out and log back in, you can try setting this in your .bash_profile or /etc/profile so that it runs first every time you log in, it isn't a 'fix' but more of a 'hack'.

devnull
  • 5.5k
  • 24
  • 36