# coding=utf-8 """@Time : 2019/01/21 上午 10:27 @Author : hzsyy@FileName: modifySystemTime.py@IDE : PyCharm"""import osimport timeimport ntplibc = ntplib.NTPClient()response = c.request('pool.ntp.org')ts = response.tx_timenewDate = time.strftime('%Y-%m-%d', time.localtime(ts))_time = time.strftime('%X', time.localtime(ts))oldDate = "2018-12-20"os.system('date {} && time {}'.format(oldDate, _time))time.sleep(5)os.popen(r"D://xshell//Xshell.exe")time.sleep(4)os.system('date {} && time {}'.format(newDate, _time)) 来源: https://www.cnblogs.com/yanpan/p/11750399.html