Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
import win32api win32api.SetSystemTime (timetuple[0], timetuple[1], timetuple[6],timetuple[2], timetuple[3], timetuple[4], timetuple[5], 0)
我使用此代码更改 Windows 上的系统时间。但是当我运行此代码时,它会自动添加 +8 小时或取决于计算机中设置的时区。如果不添加时区,我将如何设置时间?
谢谢,
根据 MSDN:
设置系统时间函数 设置当前系统时间和日期。系统时间以协调世界时 ( UTC ) 表示。
设置系统时间函数
设置当前系统时间和日期。系统时间以协调世界时 ( UTC ) 表示。
如果要使用计算机的默认时区,则应使用SetLocalTime函数。