diff --git a/src/xenia/kernel/xam/achievement_manager.h b/src/xenia/kernel/xam/achievement_manager.h index 0efd18814..bd04d524b 100644 --- a/src/xenia/kernel/xam/achievement_manager.h +++ b/src/xenia/kernel/xam/achievement_manager.h @@ -65,6 +65,15 @@ struct X_ACHIEVEMENT_UNLOCK_TIME { low_part = static_cast(filetime); } + X_ACHIEVEMENT_UNLOCK_TIME(std::time_t time) { + const auto file_time = + chrono::WinSystemClock::to_file_time(chrono::WinSystemClock::from_sys( + std::chrono::system_clock::from_time_t(time))); + + high_part = static_cast(file_time >> 32); + low_part = static_cast(file_time); + } + chrono::WinSystemClock::time_point to_time_point() const { const uint64_t filetime = (static_cast(high_part) << 32) | low_part;