From: Yehuda Sadeh Date: Tue, 15 Mar 2016 20:29:48 +0000 (-0700) Subject: rgw: extend date/time parsing X-Git-Tag: v10.1.0~73^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e82a8013363a03565090542fc7b659d1b5f8058c;p=ceph.git rgw: extend date/time parsing So that we can parse correctly time encoded using utime_t::gmtime() Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 62f02ed309a..d597339a7e7 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -396,10 +396,14 @@ bool parse_iso8601(const char *s, struct tm *t, uint32_t *pns, bool extended_for if (!s) s = ""; - if (extended_format) + if (extended_format) { p = strptime(s, "%Y-%m-%dT%T", t); - else + if (!p) { + p = strptime(s, "%Y-%m-%d %T", t); + } + } else { p = strptime(s, "%Y%m%dT%H%M%S", t); + } if (!p) { dout(0) << "parse_iso8601 failed" << dendl; return false;