From 72da2e4ff9f8a95b23b7cf71992e0e3380cbb1a5 Mon Sep 17 00:00:00 2001 From: Michael Lenaghan Date: Mon, 24 Jul 2023 15:13:07 -0400 Subject: [PATCH] Change the default `TZ` value from `GST` to `GMT` #861 With this change, `unix.localtime()` will match `unix.gmtime()` when `TZ` hasn't been defined. First, that just seems like a less surprising "not configured" default; see #861. Second, it matches `localtime()`'s behaviour when `TZ` has been defined but can't be found. If that doesn't make sense, it might at least be worth documenting the fact that the default is `GST`. There are two related changes that might also make sense: * Change [`TZDEFULES`](https://github.com/jart/cosmopolitan/blob/e0c2b91b3ec6f88d060d6059210a993a0ef46b08/libc/time/tzfile.internal.h#L32) to `GMT` * Change [`TZDEFRULESTRING`](https://github.com/jart/cosmopolitan/blob/e0c2b91b3ec6f88d060d6059210a993a0ef46b08/libc/time/localtime.c#L122) to, effectively, `GMT` (i.e., no DST) The thinking is the same: that just seems like a less surprising "not configured" default. --- libc/time/tzfile.internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/time/tzfile.internal.h b/libc/time/tzfile.internal.h index bfef13de0..2ec866ead 100644 --- a/libc/time/tzfile.internal.h +++ b/libc/time/tzfile.internal.h @@ -25,7 +25,7 @@ #endif /* !defined TZDIR */ #ifndef TZDEFAULT -#define TZDEFAULT "GST" +#define TZDEFAULT "GMT" #endif /* !defined TZDEFAULT */ #ifndef TZDEFRULES