From 630e0407297d2b19687c7390cb271e72c715cb43 Mon Sep 17 00:00:00 2001 From: keineahnung2345 Date: Fri, 29 Nov 2019 11:30:19 +0800 Subject: [PATCH 1/2] UTC -> local timezone --- include/crow/logging.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/crow/logging.h b/include/crow/logging.h index db8f72f93..36f170363 100644 --- a/include/crow/logging.h +++ b/include/crow/logging.h @@ -52,9 +52,9 @@ namespace crow tm my_tm; #if defined(_MSC_VER) or defined(__MINGW32__) - gmtime_s(&my_tm, &t); + localtime_s(&my_tm, &t); #else - gmtime_r(&t, &my_tm); + localtime_r(&t, &my_tm); #endif size_t sz = strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", &my_tm); From 463d52a09f47f75a59100e23d0c4e89a095609e2 Mon Sep 17 00:00:00 2001 From: keineahnung2345 Date: Fri, 29 Nov 2019 11:32:14 +0800 Subject: [PATCH 2/2] UTC -> local timezone --- include/crow/http_server.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/crow/http_server.h b/include/crow/http_server.h index 548ea7a30..dbcd38382 100644 --- a/include/crow/http_server.h +++ b/include/crow/http_server.h @@ -83,9 +83,9 @@ namespace crow tm my_tm; #if defined(_MSC_VER) or defined(__MINGW32__) - gmtime_s(&my_tm, &last_time_t); + localtime_s(&my_tm, &last_time_t); #else - gmtime_r(&last_time_t, &my_tm); + localtime_r(&last_time_t, &my_tm); #endif date_str.resize(100); size_t date_str_sz = strftime(&date_str[0], 99, "%a, %d %b %Y %H:%M:%S GMT", &my_tm);