File tree Expand file tree Collapse file tree 3 files changed +15
-16
lines changed
Expand file tree Collapse file tree 3 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 1818
1919// Unavoidable because these are in util.h.
2020extern fs::path &GetDataDir (bool fNetSpecific );
21- extern std::string DateTimeStrFormat (const char * pszFormat, int64_t nTime);
2221extern bool GetBoolArg (const std::string& strArg, bool fDefault );
2322extern int64_t GetArg (const std::string& strArg, int64_t nDefault);
2423
Original file line number Diff line number Diff line change @@ -31,6 +31,21 @@ extern bool fLogIPs;
3131// Unavoidable because this is in util.h.
3232extern int64_t GetAdjustedTime ();
3333
34+ inline std::string DateTimeStrFormat (const char * pszFormat, int64_t nTime)
35+ {
36+ time_t n = nTime;
37+ struct tm * ptmTime = gmtime (&n);
38+ char pszTime[200 ];
39+ strftime (pszTime, sizeof (pszTime), pszFormat, ptmTime);
40+ return pszTime;
41+ }
42+
43+ static const std::string strTimestampFormat = " %Y-%m-%d %H:%M:%S UTC" ;
44+ inline std::string DateTimeStrFormat (int64_t nTime)
45+ {
46+ return DateTimeStrFormat (strTimestampFormat.c_str (), nTime);
47+ }
48+
3449struct CLogCategoryActive
3550{
3651 std::string category;
Original file line number Diff line number Diff line change @@ -275,21 +275,6 @@ inline int64_t GetPerformanceCounter()
275275 return nCounter;
276276}
277277
278- inline std::string DateTimeStrFormat (const char * pszFormat, int64_t nTime)
279- {
280- time_t n = nTime;
281- struct tm * ptmTime = gmtime (&n);
282- char pszTime[200 ];
283- strftime (pszTime, sizeof (pszTime), pszFormat, ptmTime);
284- return pszTime;
285- }
286-
287- static const std::string strTimestampFormat = " %Y-%m-%d %H:%M:%S UTC" ;
288- inline std::string DateTimeStrFormat (int64_t nTime)
289- {
290- return DateTimeStrFormat (strTimestampFormat.c_str (), nTime);
291- }
292-
293278inline bool IsSwitchChar (char c)
294279{
295280#ifdef WIN32
You can’t perform that action at this time.
0 commit comments