mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Migrate off of posix_time and most uses of C time_t.
This commit is contained in:
committed by
Vinnie Falco
parent
2e2a7509cd
commit
5d9e53a37d
@@ -36,10 +36,15 @@ std::string getHTTPHeaderTimestamp ()
|
||||
char buffer[96];
|
||||
time_t now;
|
||||
time (&now);
|
||||
struct tm* now_gmt = gmtime (&now);
|
||||
struct tm now_gmt{};
|
||||
#ifndef _MSC_VER
|
||||
gmtime_r(&now, &now_gmt);
|
||||
#else
|
||||
gmtime_s(&now_gmt, &now);
|
||||
#endif
|
||||
strftime (buffer, sizeof (buffer),
|
||||
"Date: %a, %d %b %Y %H:%M:%S +0000\r\n",
|
||||
now_gmt);
|
||||
&now_gmt);
|
||||
return std::string (buffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user