Skip to content

Instantly share code, notes, and snippets.

@bfgh012
bfgh012 / sync-time.ps1
Last active March 6, 2023 18:17
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