MCPcopy Create free account
hub / github.com/chen3feng/toft / HttpDateToTm

Function HttpDateToTm

net/http/time.cpp:20–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20static bool HttpDateToTm(const char* str, struct tm* tm)
21{
22 locale_t c_locate = GetCLocale();
23 char* end;
24
25 if ((end = strptime_l(str, "%c", tm, c_locate)) && *end == '\0')
26 return true;
27
28 // rfc1123-date
29 if ((end = strptime_l(str, "%a, %d %b %Y %H:%M:%S GMT", tm, c_locate))
30 && *end == '\0')
31 return true;
32
33 // rfc950-date
34 if ((end = strptime_l(str, "%A, %d-%b-%y %H:%M:%S GMT", tm, c_locate))
35 && *end == '\0')
36 return true;
37
38 return false;
39}
40
41bool ParseHttpTime(const char* str, time_t* time)
42{

Callers 1

ParseHttpTimeFunction · 0.85

Calls 1

GetCLocaleFunction · 0.85

Tested by

no test coverage detected