Feature #302 » 0001-rgw-Parse-times-correctly-and-convert-them-to-GMT-so.patch
src/rgw/rgw_common.cc | ||
---|---|---|
{
|
||
struct tm tm;
|
||
memset(&tm, 0, sizeof(struct tm));
|
||
if (!strptime(time_str, "%FT%T%z", &tm))
|
||
if (!strptime(time_str, "%a, %d %b %Y %H:%M:%S GMT", &tm))
|
||
return -EINVAL;
|
||
*time = mktime(&tm);
|
||
const time_t localtime = mktime(&tm);
|
||
struct tm *localtm = gmtime(&localtime);
|
||
*time = mktime(localtm);
|
||
return 0;
|
||
}
|