summaryrefslogtreecommitdiff
path: root/louloulibs
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-09-17 00:34:28 +0200
committerlouiz’ <louiz@louiz.org>2016-09-17 00:34:28 +0200
commitaaa2ca670ab5f19390e77a1f5ea88017b312ceaf (patch)
treee1fdeabcf8a9f1d045808de7f2fd00343d90286b /louloulibs
parenta8d28a38d4f61ffef29b3bf2325db6d206cf73ac (diff)
downloadbiboumi-aaa2ca670ab5f19390e77a1f5ea88017b312ceaf.tar.gz
biboumi-aaa2ca670ab5f19390e77a1f5ea88017b312ceaf.tar.bz2
biboumi-aaa2ca670ab5f19390e77a1f5ea88017b312ceaf.tar.xz
biboumi-aaa2ca670ab5f19390e77a1f5ea88017b312ceaf.zip
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.
Diffstat (limited to 'louloulibs')
-rw-r--r--louloulibs/utils/time.cpp4
1 files changed, 2 insertions, 2 deletions
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
+}