mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Merge pull request #368 from kingster/feature-localtime
Support for `CROW_USE_LOCALTIMEZONE` for using localtime in logs
This commit is contained in:
commit
7f2da9b1c7
@ -72,9 +72,17 @@ namespace crow
|
||||
tm my_tm;
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#ifdef CROW_USE_LOCALTIMEZONE
|
||||
localtime_s(&my_tm, &t);
|
||||
#else
|
||||
gmtime_s(&my_tm, &t);
|
||||
#endif
|
||||
#else
|
||||
#ifdef CROW_USE_LOCALTIMEZONE
|
||||
localtime_r(&t, &my_tm);
|
||||
#else
|
||||
gmtime_r(&t, &my_tm);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
size_t sz = strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", &my_tm);
|
||||
|
Loading…
Reference in New Issue
Block a user