| 179 | } |
| 180 | |
| 181 | std::string FormatShortDate(std::time_t timestamp) |
| 182 | { |
| 183 | SYSTEMTIME st = TimeToSystemTime(timestamp); |
| 184 | std::string result; |
| 185 | |
| 186 | wchar_t date[20]; |
| 187 | ptrdiff_t charsWritten = GetDateFormatEx( |
| 188 | LOCALE_NAME_USER_DEFAULT, DATE_SHORTDATE, &st, nullptr, date, static_cast<int>(std::size(date)), nullptr); |
| 189 | if (charsWritten != 0) |
| 190 | { |
| 191 | result = String::toUtf8(std::wstring_view(date, charsWritten - 1)); |
| 192 | } |
| 193 | return result; |
| 194 | } |
| 195 | |
| 196 | std::string FormatTime(std::time_t timestamp) |
| 197 | { |
nothing calls this directly
no test coverage detected