From 2102b065d4ed91c5199c1dececdec4e385657cfd Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 2 Mar 2025 14:15:02 +0000 Subject: Add Duration::ToHuman and update messages to use it. --- include/timeutils.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') 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, -- cgit v1.3.1-10-gc9f91