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`](e0c2b91b3e/libc/time/tzfile.internal.h (L32)) to `GMT`
* Change [`TZDEFRULESTRING`](e0c2b91b3e/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.
This commit is contained in:
Michael Lenaghan 2023-07-24 15:13:07 -04:00 committed by GitHub
parent e0c2b91b3e
commit 72da2e4ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@
#endif /* !defined TZDIR */
#ifndef TZDEFAULT
#define TZDEFAULT "GST"
#define TZDEFAULT "GMT"
#endif /* !defined TZDEFAULT */
#ifndef TZDEFRULES