Skip to content

Instantly share code, notes, and snippets.

@AnimusXCASH
AnimusXCASH / ntp_update_time.py
Created August 3, 2020 04:25 — forked from nihal111/ntp_update_time.py
A python script to update system time in Windows by attempting to fetch time from multiple NTP servers from a defined list.
import socket
import struct
import sys
import time
import datetime
import win32api
# List of servers in order of attempt of fetching
server_list = ['ntp.iitb.ac.in', 'time.nist.gov', 'time.windows.com', 'pool.ntp.org']