Skip to content

Instantly share code, notes, and snippets.

@bfgh012
Last active March 6, 2023 18:17
Show Gist options
  • Save bfgh012/ecd119457a25186724a01acacf3bb80c to your computer and use it in GitHub Desktop.
Save bfgh012/ecd119457a25186724a01acacf3bb80c to your computer and use it in GitHub Desktop.
sync time without NTP - For Windows, Powershell
$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