From 46c5570b1d900976aa0868ceae33ab8e81dc4287 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 10 May 2025 14:25:01 +0100 Subject: Use UTC in timestamps shown to users. --- src/misc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/misc.cpp') diff --git a/src/misc.cpp b/src/misc.cpp index 17401cc15..d8a6e8f72 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -541,11 +541,11 @@ Anope::string Anope::Duration(time_t t, const NickCore *nc) Anope::string Anope::strftime(time_t t, const NickCore *nc, bool short_output) { - tm tm = *localtime(&t); char buf[BUFSIZE]; - strftime(buf, sizeof(buf), Language::Translate(nc, _("%b %d %Y %H:%M:%S %Z")), &tm); + strftime(buf, sizeof(buf), Language::Translate(nc, _("%b %d %Y %H:%M:%S %Z")), gmtime(&t)); if (short_output) return buf; + if (t < Anope::CurTime) return Anope::string(buf) + " " + Anope::printf(Language::Translate(nc, _("(%s ago)")), Duration(Anope::CurTime - t, nc).c_str(), nc); else if (t > Anope::CurTime) -- cgit