From 4bcd008416f7990cc3e45421517827e660beb537 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni <slingamn@cs.stanford.edu> Date: Mon, 17 Mar 2025 02:22:25 -0400 Subject: [PATCH] fix CHATHISTORY TARGETS from MySQL backend using server local TZ (#2224) time.Unix() returns a time.Time with the Location populated to the server's timezone. Such times will format incorrectly with IRCv3TimestampFormat unless they are manually converted to UTC. --- irc/mysql/history.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irc/mysql/history.go b/irc/mysql/history.go index 4b967104..5f9eff10 100644 --- a/irc/mysql/history.go +++ b/irc/mysql/history.go @@ -961,7 +961,7 @@ func (mysql *MySQL) listCorrespondentsInternal(ctx context.Context, target strin } results = append(results, history.TargetListing{ CfName: correspondent, - Time: time.Unix(0, nanotime), + Time: time.Unix(0, nanotime).UTC(), }) } @@ -1014,7 +1014,7 @@ func (mysql *MySQL) ListChannels(cfchannels []string) (results []history.TargetL } results = append(results, history.TargetListing{ CfName: target, - Time: time.Unix(0, nanotime), + Time: time.Unix(0, nanotime).UTC(), }) } return