ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Idea : One Shot System Time Sync

<< < (3/3)

MilesAhead:
Thanks skwire.  :)

I got bogged down trying to run the htpdate command as administrator to avoid typing the stuff in.  Then I did a .cmd file for the same reason.  I finally remembered I could simply go into the compatibility tab for the compiled program and set it to run as admin.. :-[

At least now I can click an icon in the taskbar.  It sounds a chime as clue something is happening.  By the time the icon departs the system tray the time display should change.


--- Code: Autohotkey ---SoundPlay *64RunWait,htpdate www.timeanddate.com set,,HideExit
For grins after running it I use the Time.is website to get a read sync and tell me how close my clock is to standard.  All the variances have been within a second so far.  Better than typing in the time in a prompt adding on a few seconds.  :)

Stoic Joker:
For grins after running it I use the Time.is website to get a read sync and tell me how close my clock is to standard.
-MilesAhead (May 25, 2016, 03:55 PM)
--- End quote ---

Damn that is a handy site, never heard of it before. I just tried it cold on our system here and got:The difference from Time.is was +0.023 seconds (±0.021 seconds).
--- End quote ---

I gotta go back and figure out what I did to the time service on our (VM) host machines...it's apparently working.

MilesAhead:
Damn that is a handy site, never heard of it before.
-Stoic Joker (May 26, 2016, 06:52 AM)
--- End quote ---

Me either.  I googled "exact time" and it came up high in the results.  I still can't believe that for a long while I fooled around with that stupid Gui Windows time set thing on the clock.  Man is that an annoying way to try to set the time!  By the time you mess around with the little up arrows the time has gone by.  Much easier to use "time" on the command line.  :)

4wd:
The Powershell version:


--- Code: PowerShell ---# https://social.technet.microsoft.com/Forums/windowsserver/en-US/1a4467e5-9b9e-4ef1-9b22-4af3a1a77362/setting-system-time-with-powershell?forum=winserverpowershellfunction Set-Time ([string]$dateTime) {  Set-Date (Get-Date $dateTime)}Set-Time (Invoke-WebRequest -Uri "http://www.google.com").Headers.Date | Out-Null
Needs a admin privileged console due to the Set-Date cmdlet.

Or create a shortcut with the following as the Target:

--- Code: Text ---%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -sta -noprofile -executionpolicy bypass -Window Hidden -Command "& Set-Date(Get-Date([string](iwr 'http://www.google.com').Headers.Date)) | Out-Null"
And set Run as administrator under Properties->Shortcut->Advanced.

MilesAhead:
The Powershell version:
-4wd (May 28, 2016, 08:50 PM)
--- End quote ---

Thanks for the contribution. 



Navigation

[0] Message Index

[*] Previous page

Go to full version