mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 11:29:01 +08:00
pattern_formatter support most strftime format
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
#include<string>
|
||||
#include<cstdio>
|
||||
#include<ctime>
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
namespace c11log
|
||||
{
|
||||
@@ -81,6 +84,17 @@ inline bool fopen_s(FILE** fp, const std::string& filename, const char* mode)
|
||||
#endif
|
||||
}
|
||||
|
||||
inline float tz_offset()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
TIME_ZONE_INFORMATION tzinfo;
|
||||
GetTimeZoneInformation(&tzinfo);
|
||||
return tzinfo.Bias / -60.0f;
|
||||
#else
|
||||
return 0.0f;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
} //os
|
||||
} //details
|
||||
|
Reference in New Issue
Block a user