diff options
| author | practicalswift <[email protected]> | 2018-02-28 16:46:31 +0100 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2018-03-09 15:02:01 +0100 |
| commit | a7324bd799591546c2ae069f29cb82a66d427769 (patch) | |
| tree | b99b314c2166933c3a4e3843173e5cba9789555e /src/utiltime.h | |
| parent | Merge #12607: depends: Remove ccache (diff) | |
| download | discoin-a7324bd799591546c2ae069f29cb82a66d427769.tar.xz discoin-a7324bd799591546c2ae069f29cb82a66d427769.zip | |
Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z")
* Z is the zone designator for the zero UTC offset.
* T is the delimiter used to separate date and time.
This makes it clear for the end-user that the date/time logged is
specified in UTC and not in the local time zone.
Diffstat (limited to 'src/utiltime.h')
| -rw-r--r-- | src/utiltime.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utiltime.h b/src/utiltime.h index 56cc31da6..807c52ffa 100644 --- a/src/utiltime.h +++ b/src/utiltime.h @@ -27,6 +27,14 @@ void SetMockTime(int64_t nMockTimeIn); int64_t GetMockTime(); void MilliSleep(int64_t n); +/** + * ISO 8601 formatting is preferred. Use the FormatISO8601{DateTime,Date,Time} + * helper functions if possible. + */ std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); +std::string FormatISO8601DateTime(int64_t nTime); +std::string FormatISO8601Date(int64_t nTime); +std::string FormatISO8601Time(int64_t nTime); + #endif // BITCOIN_UTILTIME_H |