summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRALOVICH, Kristof <tade60@freemail.hu>2014-04-08 15:32:21 +0200
committerRALOVICH, Kristof <tade60@freemail.hu>2014-04-08 15:32:21 +0200
commit46acf301ea9a3469f5cf1631acd1cb13f4f44bb2 (patch)
tree6fc4beef75dccb0d6c898fae67d13e952a47d93f /src
parent1a6f657d41791355d30e0818b8ef55a43acada8f (diff)
str2time: boost did not recognize this format
Diffstat (limited to 'src')
-rw-r--r--src/DeviceSettings.cpp6
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;