Question

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,

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top