mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
17 lines
425 B
C++
17 lines
425 B
C++
|
#include <Geode/utils/general.hpp>
|
||
|
|
||
|
#ifdef GEODE_IS_WINDOWS
|
||
|
#define GEODE_CTIME() ctime_s(buf, sizeof buf, &t);
|
||
|
#else
|
||
|
#define GEODE_CTIME() strcpy(buf, ctime(&t));
|
||
|
#endif
|
||
|
|
||
|
std::string geode::utils::timePointAsString(const std::chrono::system_clock::time_point& tp) {
|
||
|
auto t = std::chrono::system_clock::to_time_t(tp);
|
||
|
char buf[128];
|
||
|
GEODE_CTIME();
|
||
|
std::string res = buf;
|
||
|
res.pop_back();
|
||
|
return res;
|
||
|
}
|