質問

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

I use this code to change system time on windows. But when i run this code it will automatically add +8 hours or depending on the timezone set in the computer. How will i set the time without it adding the timezone?

thanks,

役に立ちましたか?

解決

According to the MSDN:

SetSystemTime function

Sets the current system time and date. The system time is expressed in Coordinated Universal Time (UTC).

You should use the SetLocalTime function if you want to use the computer's default timezone.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top