[Pkg-running-devel] [antpm] 41/48: str2time: boost did not recognize this format

Kristof Ralovich ralovich-guest at moszumanska.debian.org
Mon Aug 11 10:10:34 UTC 2014


This is an automated email from the git hooks/post-receive script.

ralovich-guest pushed a commit to branch upstream
in repository antpm.

commit 46acf301ea9a3469f5cf1631acd1cb13f4f44bb2
Author: RALOVICH, Kristof <tade60 at freemail.hu>
Date:   Tue Apr 8 15:32:21 2014 +0200

    str2time: boost did not recognize this format
---
 src/DeviceSettings.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/antpm.git



More information about the Pkg-running-devel mailing list