diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-05-08 18:01:10 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-05-23 16:04:02 +0200 |
commit | a62649723bab311107468038e41bf76410990423 (patch) | |
tree | cc81cddea34380368b2fb99c005f3dd7ed36fdea /src/util.h | |
parent | e0036e9f0e0240541bf5a4ebcd8087be99739e71 (diff) | |
download | bitcoin-a62649723bab311107468038e41bf76410990423.tar.xz |
Replace non-threadsafe gmtime and setlocale
Make DateTimeStrFormat use boost::posix_time.
Also re-enable the util_DateTimeStrFormat tests, as they are no
longer platform specific.
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 3e8ac6a
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/util.h b/src/util.h index 5555e1b336..89c6016698 100644 --- a/src/util.h +++ b/src/util.h @@ -320,14 +320,7 @@ inline int64_t GetTimeMicros() boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds(); } -inline std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime) -{ - time_t n = nTime; - struct tm* ptmTime = gmtime(&n); - char pszTime[200]; - strftime(pszTime, sizeof(pszTime), pszFormat, ptmTime); - return pszTime; -} +std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); template<typename T> void skipspaces(T& it) |