On 2026-07-20 05:58, James Bellaire wrote:
Does POSIX correctly handle "EST4" "CST5" "MST6" "PST7"?
Yes, and that's been true since the first POSIX edition in 1988. I would
be surprised if any current POSIX implementation mishandled standardized
commands like "TZ=EST4 date".
That being said, if the proposed US changes happen there will be
problems with extensions to POSIX that parse alphabetic time zone
abbreviations. For example, with GNU coreutils 9.10 the shell command
"TZ=EST4 date -u -d'2026-07-20 12:00 EST' +'%H:%MZ'" outputs "17:00Z"
because GNU date interprets "EST" to mean -05 regardless of current time
zone. Lots of programs do this sort of thing, partly for compatibility
with standards like Internet RFC 5322, and they are not likely to change
soon (if ever).
Also, non-POSIX applications downstream from TZDB will have problems
even generating time-related strings. For example, if Main.java contains
the following Java program:
public class Main {
public static void main(String[] args) {
String format = "yyyy-MM-dd HH:mm:ss z Z";
System.out.println(java.time.ZonedDateTime.now()
.format(java.time.format.DateTimeFormatter
.ofPattern(format)));
}
}
and you run these shell commands with openjdk 25.0.3 2026-04-21:
TZ=EST5EDT java Main.java
TZ=EST4 java Main.java
the output is something like this:
2026-07-20 14:48:52 EDT -0400
2026-07-20 14:48:52 GMT-04:00 -0400
Although the second line is correct it is likely not what users expect.