Skip to content

Commit 58245ed

Browse files
committed
Use CROW_USE_LOCALTIME macro for explict optin
1 parent 5e53568 commit 58245ed

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/crow/logging.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,17 @@ namespace crow
7272
tm my_tm;
7373

7474
#if defined(_MSC_VER) || defined(__MINGW32__)
75+
#ifdef CROW_USE_LOCALTIME
7576
localtime_s(&my_tm, &t);
77+
#else
78+
gmtime_s(&my_tm, &t);
79+
#endif
7680
#else
81+
#ifdef CROW_USE_LOCALTIME
7782
localtime_r(&t, &my_tm);
83+
#else
84+
gmtime_r(&t, &my_tm);
85+
#endif
7886
#endif
7987

8088
size_t sz = strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", &my_tm);

0 commit comments

Comments
 (0)