MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / USTimeToFiletime

Method USTimeToFiletime

DebugView++Lib/Conversions.cpp:71–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71FILETIME USTimeConverter::USTimeToFiletime(WORD h, WORD m, WORD s, WORD ms)
72{
73 if (m_firstValue)
74 {
75 m_firstValue = false;
76 auto st = GetSystemTime(2000, 1, 1);
77 st.wHour = h;
78 st.wMinute = m;
79 st.wSecond = s;
80 st.wMilliseconds = 0;
81 m_lastFileTime = Win32::SystemTimeToFileTime(st);
82 }
83
84 auto st = Win32::FileTimeToSystemTime(m_lastFileTime);
85 st.wHour = h;
86 st.wMinute = m;
87 st.wSecond = s;
88 st.wMilliseconds = 0;
89 auto ft = Win32::SystemTimeToFileTime(st);
90
91 if (ft < m_lastFileTime) // is ft before m_lastFileTime, then assume it is on the next day.
92 {
93 st.wDay += 1;
94 }
95 m_lastFileTime = Win32::SystemTimeToFileTime(st);
96 return Win32::LocalFileTimeToFileTime(ft); // convert to UTC
97}
98
99// read localtime in format "hh:mm:ss tt" (AM/PM postfix)
100bool USTimeConverter::ReadLocalTimeUSRegion(const std::string& text, FILETIME& ft)

Callers

nothing calls this directly

Calls 4

SystemTimeToFileTimeFunction · 0.85
FileTimeToSystemTimeFunction · 0.85
LocalFileTimeToFileTimeFunction · 0.85
GetSystemTimeFunction · 0.70

Tested by

no test coverage detected