Thread (16 messages) 16 messages, 3 authors, 3d ago

Re: [PATCH 1/3] date: add helpers to convert between "+HHMM" timezones and minutes

From: Patrick Steinhardt <hidden>
Date: 2026-09-30 12:05:35

On Wed, Sep 30, 2026 at 04:47:02AM -0700, Karthik Nayak wrote:

One suggestion: I'd recommend trimming the mails you're responding to a
bit more aggressively. Otherwise one is hunting for responses in files
and hunks that are not relevant to your remarks :)
Patrick Steinhardt [off-list ref] writes:
quoted
diff --git a/date.c b/date.c
index 014065b419..63ea9dbc76 100644
--- a/date.c
+++ b/date.c
@@ -103,8 +113,7 @@ static int local_time_tzoffset(time_t t, struct tm *tm)
 		offset = t_local - t;
 	}
 	offset /= 60; /* in minutes */
-	offset = (offset % 60) + ((offset / 60) * 100);
-	return offset * eastwest;
+	return minutes_to_tz(offset * eastwest);
While mathematically it's the same, but shouldn't this have been
`minutes_to_tz(offset) * eastwest`?
I guess we can. It's probably less confusing if we do it this way
indeed.

Patrick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help