pattern_formatter support most strftime format

This commit is contained in:
gabi
2014-10-19 02:54:45 +03:00
parent 0c6a0d52d7
commit 32a8b51d05
13 changed files with 268 additions and 53 deletions

View File

@@ -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