git: 9front

Download patch

ref: 35c16dfd5ecc3ec995f0fca1e9badea2f79cfa57
parent: 0a4f89a92a220cdd9b97974c5cba844cd5c916ce
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);
 }
--