| 69 | } |
| 70 | |
| 71 | FILETIME 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) |
| 100 | bool USTimeConverter::ReadLocalTimeUSRegion(const std::string& text, FILETIME& ft) |
nothing calls this directly
no test coverage detected