mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-05 08:10:40 -07:00
Initial commit for GitHub migration based on spice2x-25-03-03
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#include "logging.h"
|
||||
|
||||
std::string_view log_get_datetime() {
|
||||
return log_get_datetime(time(nullptr));
|
||||
}
|
||||
|
||||
std::string_view log_get_datetime(std::time_t now) {
|
||||
static thread_local char buf[64];
|
||||
|
||||
// `localtime` on Windows is thread-safe
|
||||
strftime(buf, sizeof(buf), "[%Y/%m/%d %X]", localtime(&now));
|
||||
|
||||
return buf;
|
||||
}
|
||||
Reference in New Issue
Block a user