summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_common.cc
diff options
context:
space:
mode:
authorAbhishek Lekshmanan <abhishek@suse.com>2017-07-19 15:21:07 +0200
committerAbhishek Lekshmanan <abhishek@suse.com>2017-07-19 19:44:39 +0200
commit5342d7c590677d33a2d57ea73fd116a337ef1967 (patch)
tree007f006e0e4de3678ffed93fbbab830fdaa544a4 /src/rgw/rgw_common.cc
parentMerge pull request #16380 from mikulely/doc-index-typos (diff)
downloadceph-5342d7c590677d33a2d57ea73fd116a337ef1967.tar.xz
ceph-5342d7c590677d33a2d57ea73fd116a337ef1967.zip
rgw: rgw_common introduce `rgw_to_asctime`
Basically a function that accepts a `utime_t` and spits out a asctime string representation (without newline) Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
Diffstat (limited to 'src/rgw/rgw_common.cc')
-rw-r--r--src/rgw/rgw_common.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc
index d7fb6cfdcf2..5d26d1bd67e 100644
--- a/src/rgw/rgw_common.cc
+++ b/src/rgw/rgw_common.cc
@@ -662,6 +662,14 @@ void rgw_to_iso8601(const real_time& t, string *dest)
*dest = buf;
}
+
+string rgw_to_asctime(const utime_t& t)
+{
+ stringstream s;
+ t.asctime(s);
+ return s.str();
+}
+
/*
* calculate the sha1 value of a given msg and key
*/