Skip to content

Instantly share code, notes, and snippets.

@bsharathchand
Created October 23, 2014 22:34
Show Gist options
  • Save bsharathchand/3db979b73571c91df3ed to your computer and use it in GitHub Desktop.
Save bsharathchand/3db979b73571c91df3ed to your computer and use it in GitHub Desktop.
Resync date & time in windows and unix system

##Synching date & time in Unix and Windows

At times, we might need to change the system time for working on some developmental and testing activities. Setting a new time is always easier, and pretty straight forward in many operating systems.

Have you ever wondered how to reset / resync the correct timestamp.

Yes, I thought so. We will try setting it back again to the correct time, instead of re-synching with the time server. Resetting the time using a time server is pretty easy, and you can do that just in a couple of steps, stated below.

Unix - (Ubuntu Flavour)

  • First set the date to a different date with this command
date -s "10 Sep 2013 15:59:59.000-UTC-0700"
  • To sync the time back to correct time stop the ntp service by executing this command
$ sudo service ntp stop
  • Now map the time server like thisl ntpdate -b pool.ntp.org (you can use any other time server)

  • Start the ntp service back again sudo service ntp start

Windows - (Windows 8)

  • Click the date from the taskbar.

  • Now click Change Date & Time Settings

  • Under Date and Time tab you can change the current system time using the Change date and time option

  • When you want to resync, navigate to the Internet Time and click on Change settings... button.

  • In the opened pop up window, select the server you want to use for synchronization and click Update now button.

  • This will show the running status of the synchronization. Once the date and time are synchronized you can click on ok and close the window.

Hope this helps - Sharath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment