Project

General

Profile

Feature #302 » 0001-rgw-Parse-times-correctly-and-convert-them-to-GMT-so.patch

Wido den Hollander, 07/23/2010 02:35 PM

View differences:

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;
}
(1-1/2)