代码语言:javascript复制
#!/usr/bin/env python
# coding: utf8
# Usage: 指定ntpserver域名到ntpserver_domains变量即可
import socket
import struct
import time
import win32api
import subprocess
import os
import sys
def gettime(ntpserver_ips):
TIME_1970 = 2208988800L
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
client.settimeout(3)
data = 'x1b' 47 * '