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

Method ReadLocalTimeUSRegion

DebugView++Lib/Conversions.cpp:100–115  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

98
99// read localtime in format "hh:mm:ss tt" (AM/PM postfix)
100bool USTimeConverter::ReadLocalTimeUSRegion(const std::string& text, FILETIME& ft)
101{
102 std::istringstream is(text);
103 WORD h, m, s;
104 char c1, c2, p1, p2;
105 if (!((is >> h >> c1 >> m >> c2 >> s) && c1 == ':' && c2 == ':'))
106 return false;
107 if (h == 12)
108 h = 0;
109
110 if (is >> p1 >> p2 && p1 == 'P' && p2 == 'M')
111 h += 12;
112
113 ft = USTimeToFiletime(h, m, s, 0);
114 return true;
115}
116
117// read localtime in format "hh:mm:ss.ms tt" (AM/PM postfix)
118bool USTimeConverter::ReadLocalTimeUSRegionMs(const std::string& text, FILETIME& ft)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected