Init
This commit is contained in:
13
tools.cpp
Normal file
13
tools.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "tools.h"
|
||||
|
||||
std::string get_utc8_time() {
|
||||
auto now = std::chrono::system_clock::now();
|
||||
std::time_t now_time = std::chrono::system_clock::to_time_t(now);
|
||||
|
||||
now_time += 8 * 3600;
|
||||
|
||||
std::tm *tm = std::gmtime(&now_time);
|
||||
std::stringstream ss;
|
||||
ss << std::put_time(tm, "%Y-%m-%d %H:%M:%S");
|
||||
return ss.str();
|
||||
}
|
||||
Reference in New Issue
Block a user