diff options
author | Sadie Powell <sadie@witchery.services> | 2025-05-10 14:25:01 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-05-10 14:40:12 +0100 |
commit | 46c5570b1d900976aa0868ceae33ab8e81dc4287 (patch) | |
tree | e09934c8f4b97d8c2b66f4b683f53c01f8580810 /src/misc.cpp | |
parent | 151795a1dff08d13243f59bc4f19d3f99655a1a0 (diff) |
Use UTC in timestamps shown to users.
Diffstat (limited to 'src/misc.cpp')
-rw-r--r-- | src/misc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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) |