aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-09-28 12:10:38 +0100
committerfanquake <fanquake@gmail.com>2022-10-01 11:41:53 +0100
commit079cf88c0df6de038b8f8933d55c0d17af007b43 (patch)
tree6cd3bfb3be86f446e275dd48f50fd469ff8554c7 /src/util
parentf59e91511a3aa8b2770eeec7034ddc1a9dec918b (diff)
refactor: move Boost datetime usage to wallet
This means we don't need datetime in a --disable-wallet build, and it isn't included in the kernel.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/time.cpp16
-rw-r--r--src/util/time.h1
2 files changed, 0 insertions, 17 deletions
diff --git a/src/util/time.cpp b/src/util/time.cpp
index f6d37347f8..0b20849079 100644
--- a/src/util/time.cpp
+++ b/src/util/time.cpp
@@ -12,8 +12,6 @@
#include <util/time.h>
#include <util/check.h>
-#include <boost/date_time/posix_time/posix_time.hpp>
-
#include <atomic>
#include <chrono>
#include <ctime>
@@ -142,20 +140,6 @@ std::string FormatISO8601Date(int64_t nTime) {
return strprintf("%04i-%02i-%02i", ts.tm_year + 1900, ts.tm_mon + 1, ts.tm_mday);
}
-int64_t ParseISO8601DateTime(const std::string& str)
-{
- static const boost::posix_time::ptime epoch = boost::posix_time::from_time_t(0);
- static const std::locale loc(std::locale::classic(),
- new boost::posix_time::time_input_facet("%Y-%m-%dT%H:%M:%SZ"));
- std::istringstream iss(str);
- iss.imbue(loc);
- boost::posix_time::ptime ptime(boost::date_time::not_a_date_time);
- iss >> ptime;
- if (ptime.is_not_a_date_time() || epoch > ptime)
- return 0;
- return (ptime - epoch).total_seconds();
-}
-
struct timeval MillisToTimeval(int64_t nTimeout)
{
struct timeval timeout;
diff --git a/src/util/time.h b/src/util/time.h
index 4f9bde5d56..0ec79bec32 100644
--- a/src/util/time.h
+++ b/src/util/time.h
@@ -109,7 +109,6 @@ T GetTime()
*/
std::string FormatISO8601DateTime(int64_t nTime);
std::string FormatISO8601Date(int64_t nTime);
-int64_t ParseISO8601DateTime(const std::string& str);
/**
* Convert milliseconds to a struct timeval for e.g. select.