mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #7903 from AaronVanGeffen/fix/7899
Use localtime instead of gmtime in file browser
This commit is contained in:
commit
0d99186085
|
@ -36,6 +36,7 @@
|
|||
- Fix: [#7804] Russian ride descriptions are cut off.
|
||||
- Fix: [#7872] CJK tooltips are often cut off.
|
||||
- Fix: [#7895] Import of Mega Park and the RCT1 title music do not work on some RCT1 sources.
|
||||
- Improved: [#7899] Timestamps in the load/save screen are now displayed using local timezone instead of GMT.
|
||||
|
||||
0.2.0 (2018-06-10)
|
||||
------------------------------------------------------------------------
|
||||
|
|
|
@ -73,14 +73,14 @@ namespace Platform
|
|||
std::string FormatShortDate(std::time_t timestamp)
|
||||
{
|
||||
char date[20];
|
||||
std::strftime(date, sizeof(date), "%x", std::gmtime(×tamp));
|
||||
std::strftime(date, sizeof(date), "%x", std::localtime(×tamp));
|
||||
return std::string(date);
|
||||
}
|
||||
|
||||
std::string FormatTime(std::time_t timestamp)
|
||||
{
|
||||
char time[20];
|
||||
std::strftime(time, sizeof(time), "%X", std::gmtime(×tamp));
|
||||
std::strftime(time, sizeof(time), "%X", std::localtime(×tamp));
|
||||
return std::string(time);
|
||||
}
|
||||
|
||||
|
|
|
@ -329,17 +329,18 @@ time_t platform_file_get_modified_time(const utf8* path)
|
|||
BOOL result = GetFileAttributesExW(wPath, GetFileExInfoStandard, &data);
|
||||
free(wPath);
|
||||
|
||||
if (result)
|
||||
{
|
||||
ULARGE_INTEGER ull;
|
||||
ull.LowPart = data.ftLastWriteTime.dwLowDateTime;
|
||||
ull.HighPart = data.ftLastWriteTime.dwHighDateTime;
|
||||
return ull.QuadPart / 10000000ULL - 11644473600ULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!result)
|
||||
return 0;
|
||||
}
|
||||
|
||||
FILETIME localFileTime;
|
||||
result = FileTimeToLocalFileTime(&data.ftLastWriteTime, &localFileTime);
|
||||
if (!result)
|
||||
return 0;
|
||||
|
||||
ULARGE_INTEGER ull;
|
||||
ull.LowPart = localFileTime.dwLowDateTime;
|
||||
ull.HighPart = localFileTime.dwHighDateTime;
|
||||
return ull.QuadPart / 10000000ULL - 11644473600ULL;
|
||||
}
|
||||
|
||||
uint8_t platform_get_locale_currency()
|
||||
|
|
Loading…
Reference in New Issue