1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 12:26:38 +02:00

Use UTC in timestamps shown to users.

This commit is contained in:
Sadie Powell
2025-05-10 14:25:01 +01:00
parent 151795a1df
commit 46c5570b1d
+2 -2
View File
@@ -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)