MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / SetSystemTime_UnixMs

Function SetSystemTime_UnixMs

source/src/scriptinterpreter.cpp:21–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19std::mutex sys_last_mutex;
20
21bool SetSystemTime_UnixMs(time_t msec)
22{
23 ULONGLONG totalTicks = 0x019DB1DED53E8000ULL + msec * 10000;
24 FILETIME ft = {};
25 ft.dwLowDateTime = (DWORD)(totalTicks & 0xFFFFFFFF);
26 ft.dwHighDateTime = (DWORD)(totalTicks >> 32);
27 SYSTEMTIME st;
28 if (FileTimeToSystemTime(&ft, &st)) return SetSystemTime(&st);
29 return false;
30}
31
32time_t TimeToS(time_t hour, time_t min, time_t sec, time_t msec)
33{

Callers 2

execMethod · 0.85
execMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected