Answer the question
In order to leave comments, you need to log in
How to set the system time?
Good afternoon, I found a script on the Internet that changes the system time
import datetime
time_tuple = (2012, # Year
9, # Month
6, # Day
0, # Hour
38, # Minute
0, # Second
0, # Millisecond
)
def _win_set_time(time_tuple):
import win32api
dayOfWeek = datetime.datetime(*time_tuple).isocalendar()[2]
t = time_tuple[:2] + (dayOfWeek,) + time_tuple[2:]
print(t)
win32api.SetSystemTime(*t)
_win_set_time(time_tuple)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question