Last active
March 6, 2023 18:17
-
-
Save bfgh012/ecd119457a25186724a01acacf3bb80c to your computer and use it in GitHub Desktop.
sync time without NTP - For Windows, Powershell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$var = (cmd /c curl -Is 1.1 | findstr "^Date:").replace("Date:", "") | |
$sec = $var.Substring(24,2) | |
$secnew = [int]$sec + 2 | |
$var = $var.Replace(":$sec GMT",":$secnew GMT") | Get-Date | Set-Date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment