diff --git a/Utilities/date_time.h b/Utilities/date_time.h new file mode 100644 index 0000000000..97e9c0a92b --- /dev/null +++ b/Utilities/date_time.h @@ -0,0 +1,32 @@ +#pragma once + +namespace date_time +{ + static inline tm get_time(time_t* _time) + { + tm buf; + time_t t = time(_time); +#ifdef _MSC_VER + localtime_s(&buf, &t); +#else + buf = *localtime(&t); +#endif + return buf; + } + + static inline std::string current_time() + { + char str[80]; + tm now = get_time(0); + strftime(str, sizeof(str), "%c", &now); + return str; + } + + static inline std::string current_time_narrow() + { + char str[80]; + tm now = get_time(0); + strftime(str, sizeof(str), "%Y%m%d%H%M%S", &now); + return str; + } +} diff --git a/rpcs3/Emu/RSX/Overlays/overlays.h b/rpcs3/Emu/RSX/Overlays/overlays.h index 5389b03229..704a135a16 100644 --- a/rpcs3/Emu/RSX/Overlays/overlays.h +++ b/rpcs3/Emu/RSX/Overlays/overlays.h @@ -1,6 +1,7 @@ #pragma once #include "overlay_controls.h" +#include "../../../Utilities/date_time.h" #include "../../../Utilities/Thread.h" #include "../../Io/PadHandler.h" #include "Emu/Memory/vm.h" @@ -14,8 +15,6 @@ #include "Utilities/CPUStats.h" #include "Utilities/Timer.h" -#include - extern u64 get_system_time(); // Definition of user interface implementations @@ -542,15 +541,6 @@ namespace rsx std::unique_ptr