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.
This commit is contained in:
1 parent
a8d28a38d4
commit
aaa2ca670a
2 files changed
+4
-2
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user