def set_clock(clock): st = SYSTEMTIME() st.wYear = clock.year st.wMonth = clock.month st.wDay = clock.day st.wHour = clock.hour st.wMinute = clock.minute st.wSecond = clock.second st.wMilliseconds = 0 KERNEL32.SetLocalTime(ctypes.byref(st))
def set_clock(clock, timeout): # Output key info to analysis log log.info("Date set to: {0}, timeout set to: {1}".format(clock, timeout)) clock = datetime.strptime(clock, "%Y%m%dT%H:%M:%S") st = SYSTEMTIME() st.wYear = clock.year st.wMonth = clock.month st.wDay = clock.day st.wHour = clock.hour st.wMinute = clock.minute st.wSecond = clock.second st.wMilliseconds = 0 KERNEL32.SetLocalTime(ctypes.byref(st))