import win32api
win32api.SetSystemTime (timetuple[0], timetuple[1],
timetuple[6],timetuple[2], timetuple[3], timetuple[4], timetuple[5], 0)
我使用此代码来更改 Windows 上的系统时间。但是当我运行此代码时,它会自动添加 +8 小时或根据计算机中设置的时区。如何在不添加时区的情况下设置时间?
谢谢
最佳答案
根据 MSDN:
SetSystemTime function
Sets the current system time and date. The system time is expressed in Coordinated Universal Time (UTC).
您应该使用SetLocalTime如果您想使用计算机的默认时区,请使用此函数。
关于python - SetSystemTime 总是根据时区添加小时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21717741/