diff options
author | RALOVICH, Kristof <tade60@freemail.hu> | 2014-04-08 15:32:21 +0200 |
---|---|---|
committer | RALOVICH, Kristof <tade60@freemail.hu> | 2014-04-08 15:32:21 +0200 |
commit | 46acf301ea9a3469f5cf1631acd1cb13f4f44bb2 (patch) | |
tree | 6fc4beef75dccb0d6c898fae67d13e952a47d93f /src | |
parent | 1a6f657d41791355d30e0818b8ef55a43acada8f (diff) |
str2time: boost did not recognize this format
Diffstat (limited to 'src')
-rw-r--r-- | src/DeviceSettings.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/DeviceSettings.cpp b/src/DeviceSettings.cpp index 38fccc4..a196e7f 100644 --- a/src/DeviceSettings.cpp +++ b/src/DeviceSettings.cpp @@ -78,7 +78,11 @@ DeviceSettings::str2time(const char* from) return 0; #else //std::string ts("2002-01-20 23:59:59.000"); - boost::posix_time::ptime t(boost::posix_time::time_from_string(from)); + std::string froms(from); + std::replace( froms.begin(), froms.end(), 'T', ' '); + std::replace( froms.begin(), froms.end(), 'Z', '.'); + froms += "000"; + boost::posix_time::ptime t(boost::posix_time::time_from_string(froms)); tm = boost::posix_time::to_tm( t ); #endif return ::mktime(&tm) - timezone; |