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

Function ReadLocalTimeMs

DebugView++Lib/FileIO.cpp:175–190  ·  view source on GitHub ↗

read localtime in format "HH:mm:ss.ms"

Source from the content-addressed store, hash-verified

173
174// read localtime in format "HH:mm:ss.ms"
175bool ReadLocalTimeMs(const std::string& text, FILETIME& ft)
176{
177 std::istringstream is(text);
178 WORD h, m, s, ms;
179 char c1, c2, d1;
180 if (!((is >> h >> c1 >> m >> c2 >> s >> d1 >> ms) && c1 == ':' && c2 == ':' && d1 == '.'))
181 return false;
182
183 SYSTEMTIME st = Win32::FileTimeToSystemTime(FILETIME());
184 st.wHour = h;
185 st.wMinute = m;
186 st.wSecond = s;
187 st.wMilliseconds = ms;
188 ft = Win32::LocalFileTimeToFileTime(Win32::SystemTimeToFileTime(st));
189 return true;
190}
191
192// read localtime in format "HH:mm:ss"
193bool ReadLocalTime(const std::string& text, FILETIME& ft)

Callers 1

Calls 3

FileTimeToSystemTimeFunction · 0.85
LocalFileTimeToFileTimeFunction · 0.85
SystemTimeToFileTimeFunction · 0.85

Tested by

no test coverage detected