时区
This commit is contained in:
parent
6cde057e87
commit
3cc40699b5
@ -26,10 +26,7 @@ std::string Logger::get_time_string()
|
||||
using namespace std::chrono;
|
||||
|
||||
auto now = system_clock::now();
|
||||
zoned_time zt{current_zone(), now};
|
||||
|
||||
auto local = zt.get_local_time();
|
||||
auto ms = duration_cast<milliseconds>(local.time_since_epoch()) % 1000;
|
||||
auto ms = duration_cast<milliseconds>(now.time_since_epoch()) % 1000;
|
||||
|
||||
std::time_t t = system_clock::to_time_t(now);
|
||||
std::tm tm_now = *std::localtime(&t);
|
||||
@ -45,10 +42,7 @@ std::string Logger::get_current_time_utc8()
|
||||
using namespace std::chrono;
|
||||
|
||||
auto now = system_clock::now();
|
||||
zoned_time zt{current_zone(), now};
|
||||
|
||||
auto local = zt.get_local_time();
|
||||
auto ms = duration_cast<milliseconds>(local.time_since_epoch()) % 1000;
|
||||
auto ms = duration_cast<milliseconds>(now.time_since_epoch()) % 1000;
|
||||
|
||||
std::time_t t = system_clock::to_time_t(now);
|
||||
std::tm tm_now = *std::localtime(&t);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user