diff options
author | rbrunner7 <rbrunner@dreamshare.ch> | 2018-10-28 14:46:58 +0100 |
---|---|---|
committer | rbrunner7 <rbrunner@dreamshare.ch> | 2018-12-12 21:49:20 +0100 |
commit | 1ebcd7b9b0b6c6a81d7439a4ba717df364c94db8 (patch) | |
tree | cb200f15b8038462a38c0051c34408d65de36f00 /src/common | |
parent | Merge pull request #4927 (diff) | |
download | monero-1ebcd7b9b0b6c6a81d7439a4ba717df364c94db8.tar.xz |
MMS (Multisig Messaging System): Initial version
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/util.cpp | 12 | ||||
-rw-r--r-- | src/common/util.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp index 58b0d8210..448f792ff 100644 --- a/src/common/util.cpp +++ b/src/common/util.cpp @@ -58,6 +58,7 @@ #include "include_base_utils.h" #include "file_io_utils.h" #include "wipeable_string.h" +#include "misc_os_dependent.h" using namespace epee; #include "crypto/crypto.h" @@ -1025,4 +1026,15 @@ std::string get_nix_version_display_string() #endif } + std::string get_human_readable_timestamp(uint64_t ts) + { + char buffer[64]; + if (ts < 1234567890) + return "<unknown>"; + time_t tt = ts; + struct tm tm; + misc_utils::get_gmt_time(tt, tm); + strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", &tm); + return std::string(buffer); + } } diff --git a/src/common/util.h b/src/common/util.h index 1c5c5f4e7..d5aca15d1 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -242,4 +242,6 @@ namespace tools #endif void closefrom(int fd); + + std::string get_human_readable_timestamp(uint64_t ts); } |