From aaa2ca670ab5f19390e77a1f5ea88017b312ceaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Sat, 17 Sep 2016 00:34:28 +0200 Subject: Fix the parse_datetime by using %Z instead of %z If anybody knows why fedora accepts both, but it only works with %z on debian, please tell me. --- louloulibs/utils/time.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'louloulibs') diff --git a/louloulibs/utils/time.cpp b/louloulibs/utils/time.cpp index 305b2ad..bc8b3f8 100644 --- a/louloulibs/utils/time.cpp +++ b/louloulibs/utils/time.cpp @@ -15,10 +15,10 @@ std::string to_string(const std::time_t& timestamp) std::time_t parse_datetime(const std::string& stamp) { struct tm tm; - if (!::strptime(stamp.data(), "%FT%T%z", &tm)) + if (!::strptime(stamp.data(), "%FT%T%Z", &tm)) return -1; auto res = ::timegm(&tm); return res; } -} \ No newline at end of file +} -- cgit v1.2.3