git: plan9front

Download patch

ref: 78c6c3ef5890556054b91849369c065a38fd09d6
parent: a470ef6f526cb39003962a7a0b0c8ffdf08200f0
author: mia soweli <inbox@tachibana-labs.org>
date: Wed Apr 16 20:19:23 EDT 2025

dossrv: convert timestamps on disk to utc correctly

dossrv stores local times on disk but does not convert them
to utc when loading. this causes reported modification times to be offset
by the inverse of your local time zone's offset from utc.

convert from local time to utc when reading back rather than
writing utc for compatibility with other implementations.

--- a/sys/src/cmd/dossrv/dossubs.c
+++ b/sys/src/cmd/dossrv/dossubs.c
@@ -1774,6 +1774,9 @@
 	tm.zone[0] = '\0';
 	tm.tzoff = 0;
 	tm.yday = 0;
+	tm.tz = tzload("local");
+
+	tmnorm(&tm);
 
 	return tm2sec(&tm);
 }
--