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

Method ReadLocalTimeUSRegionMs

DebugView++Lib/Conversions.cpp:118–134  ·  view source on GitHub ↗

read localtime in format "hh:mm:ss.ms tt" (AM/PM postfix)

Source from the content-addressed store, hash-verified

116
117// read localtime in format "hh:mm:ss.ms tt" (AM/PM postfix)
118bool USTimeConverter::ReadLocalTimeUSRegionMs(const std::string& text, FILETIME& ft)
119{
120 std::istringstream is(text);
121
122 WORD h, m, s, ms;
123 char c1, c2, p1, p2, d1;
124 if (!((is >> h >> c1 >> m >> c2 >> s >> d1 >> ms) && c1 == ':' && c2 == ':' && d1 == '.'))
125 return false;
126 if (h == 12)
127 h = 0;
128
129 if (is >> p1 >> p2 && p1 == 'P' && p2 == 'M')
130 h += 12;
131
132 ft = USTimeToFiletime(h, m, s, ms);
133 return true;
134}
135
136} // namespace debugviewpp
137} // namespace fusion

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected