read localtime in format "hh:mm:ss tt" (AM/PM postfix)
| 98 | |
| 99 | // read localtime in format "hh:mm:ss tt" (AM/PM postfix) |
| 100 | bool 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) |
| 118 | bool USTimeConverter::ReadLocalTimeUSRegionMs(const std::string& text, FILETIME& ft) |
no outgoing calls
no test coverage detected