diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-01-10 11:51:20 +0100 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-01-10 11:51:20 +0100 |
commit | 2d60c9b7380525d4fe83f0407779867593d87101 (patch) | |
tree | 4f3327c1130f66e3ffbd34a6e4fe2545987c7521 /contrib/epee | |
parent | Merge pull request #2985 (diff) | |
parent | epee: use strptime instead of std::get_time, for compatibility (diff) | |
download | monero-2d60c9b7380525d4fe83f0407779867593d87101.tar.xz |
Merge pull request #2986
373d1d50 epee: use strptime instead of std::get_time, for compatibility (moneromooo-monero)
Diffstat (limited to 'contrib/epee')
-rw-r--r-- | contrib/epee/include/storages/portable_storage_val_converters.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/epee/include/storages/portable_storage_val_converters.h b/contrib/epee/include/storages/portable_storage_val_converters.h index 52aa09eba..5d9664a65 100644 --- a/contrib/epee/include/storages/portable_storage_val_converters.h +++ b/contrib/epee/include/storages/portable_storage_val_converters.h @@ -28,6 +28,7 @@ #pragma once +#include <time.h> #include <boost/regex.hpp> #include "misc_language.h" @@ -149,9 +150,8 @@ POP_WARNINGS else if (boost::regex_match (from, boost::regex("\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\dZ"))) { // Convert to unix timestamp - std::tm tm = {}; - std::istringstream ss(from); - if (ss >> std::get_time(&tm, "%Y-%m-%dT%H:%M:%S")) + struct tm tm; + if (strptime(from.c_str(), "%Y-%m-%dT%H:%M:%S", &tm)) to = std::mktime(&tm); } else ASSERT_AND_THROW_WRONG_CONVERSION(); |