diff options
| author | 2025-03-02 14:15:02 +0000 | |
|---|---|---|
| committer | 2025-03-03 14:00:16 +0000 | |
| commit | 2102b065d4ed91c5199c1dececdec4e385657cfd (patch) | |
| tree | 344337bb5099dcbf3c0aba113d3ec07955ef00f9 /include | |
| parent | Add an 005 token to let clients know that fakelag is enabled. (diff) | |
Add Duration::ToHuman and update messages to use it.
Diffstat (limited to 'include')
| -rw-r--r-- | include/timeutils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/timeutils.h b/include/timeutils.h index c6a23bebd..a86a21b9c 100644 --- a/include/timeutils.h +++ b/include/timeutils.h @@ -38,6 +38,13 @@ namespace Duration */ CoreExport bool IsValid(const std::string& str); + /** Converts a number of seconds to a human-readable representation. + * + * e.g. 33,019,565 will result in 1 year, 2 weeks, 3 days, 4 hours, 6 + * minutes, 5 seconds. + */ + CoreExport std::string ToHuman(unsigned long duration); + /** Converts a number of seconds to a duration string. * * e.g. 33,019,565 will result in 1y2w3d4h6m5s which represents one year, |
