From e70863e2bde20d6256d4a4e4816269ae4ba39bf2 Mon Sep 17 00:00:00 2001 From: Chunting Gu Date: Mon, 31 May 2021 11:10:53 +0800 Subject: [PATCH] fix http date format error --- webcc/utility.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webcc/utility.cc b/webcc/utility.cc index e42864d..0134f8c 100644 --- a/webcc/utility.cc +++ b/webcc/utility.cc @@ -20,11 +20,11 @@ const std::string& UserAgent() { std::string HttpDate() { std::time_t t = std::time(nullptr); - std::tm* gmt = std::gmtime(&t); + std::tm gmt = *std::gmtime(&t); std::stringstream date; date.imbue(std::locale::classic()); // Use classic C locale - date << std::put_time(gmt, "%a, %d %b %y %h:%m:%s") << " GMT"; + date << std::put_time(&gmt, "%a, %d %b %Y %H:%M:%S GMT"); return date.str(); }