File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -149,8 +149,18 @@ namespace RTE {
149
149
saveNameText << std::left << std::setfill (' ' ) << std::setw (32 ) << save.SavePath .stem ().string ();
150
150
151
151
// This is so much more fucking difficult than it has any right to be
152
+ #if __cpp_lib_chrono >= 201907L
152
153
const auto saveFsTime = std::chrono::clock_cast<std::chrono::system_clock>(save.SaveDate );
153
154
const auto saveTime = std::chrono::system_clock::to_time_t (saveFsTime);
155
+ #else
156
+ // TODO - kill this monstrosity when we move to GCC13
157
+ auto saveFsTime = std::chrono::system_clock::time_point (save.SaveDate .time_since_epoch ());
158
+ #ifdef _WIN32
159
+ // Windows epoch time are the number of seconds since... 1601-01-01 00:00:00. Seriously.
160
+ saveFsTime -= std::chrono::seconds (11644473600LL );
161
+ #endif
162
+ const auto saveTime = std::chrono::system_clock::to_time_t (saveFsTime);
163
+ #endif
154
164
const auto saveTimeLocal = std::localtime (&saveTime);
155
165
156
166
std::stringstream saveDateTimeText;
You can’t perform that action at this time.
0 commit comments