SetSystemTime总是根据时区添加小时

时间:2014-02-12 03:02:44

标签: python systemtime

import win32api
win32api.SetSystemTime (timetuple[0], timetuple[1], 
timetuple[6],timetuple[2], timetuple[3], timetuple[4], timetuple[5], 0)

我使用此代码更改Windows上的系统时间。但是,当我运行此代码时,它将自动添加+8小时或取决于计算机中设置的时区。如何在没有添加时区的情况下设置时间?

感谢,

1 个答案:

答案 0 :(得分:2)

根据MSDN:

  

SetSystemTime函数

     

设置当前系统时间和日期。系统时间以表示   协调世界时( UTC )。

如果要使用计算机的默认时区,则应使用SetLocalTime功能。