MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / FormatShortDate

Function FormatShortDate

src/openrct2/platform/Platform.Win32.cpp:181–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 2

TimeToSystemTimeFunction · 0.85
toUtf8Function · 0.85

Tested by

no test coverage detected