From faf48da321a02cb5057eb77acc501fbe1f88bf0f Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Sat, 4 Jul 2026 20:52:34 +0800 Subject: [PATCH] accounts/keystore: include minutes in toISO8601 timezone offset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The timezone suffix only encoded hours, producing incorrect filenames in zones with non-zero minute offsets (e.g. UTC+05:30 → "+0530" not "+00500"). Format both hours and minutes separately. --- accounts/keystore/key.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index 34712cb842..a87915c2d1 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -230,7 +230,12 @@ func toISO8601(t time.Time) string { if name == "UTC" { tz = "Z" } else { - tz = fmt.Sprintf("%+03d00", offset/3600) + hours := offset / 3600 + minutes := (offset % 3600) / 60 + if minutes < 0 { + minutes = -minutes + } + tz = fmt.Sprintf("%+03d%02d", hours, minutes) } return fmt.Sprintf("%04d-%02d-%02dT%02d-%02d-%02d.%09d%s", t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), tz)