[Toybox] [PATCH] date: fix various time zone/daylight time issues.

Rob Landley rob at landley.net
Wed Mar 13 16:05:36 PDT 2019


On 3/12/19 8:09 PM, enh via Toybox wrote:
> Sunday's transition in the US broke a bunch of the tests. Worse, it
> broke some of the QA folks' scripts. Finally, the boil that is date's
> handling of time zones and daylight time has come to a head...
> 
> This patch fixes the newly-failing tests *and* the other tests that were
> checked in failing to serve as TODOs.
> 
> I've resolved the test TODOs about whether implied year/century in POSIX
> format should mean the current year or 1900 in favor of the current
> year. Both busybox and coreutils agree, and Rob fixed the code recently
> so toybox agrees too, but without fixing the tests.
> 
> I've switched tests from Europe/London to Europe/Berlin to avoid
> disagreements between C libraries about whether to say "GMT" or "UTC"
> when daylight savings is not in force.

My own efforts in that area were:

-# makes mistakes harder to spot.
-tz=Europe/London
+# makes mistakes harder to spot. Pick one with no Daylight Savings Time
+# to avoid dealing with BST (British Summer Time) and friends.
+TZD="TZ=US/Arizona date"

And stuff like:

+# Test is racy if run just beore midnight, especially on new year's
+SKIP_HOST=1 testing "-d MMDDhhmm" "$TZD -d 06021234 2>&1" \
+  "$(date +%a) Jun  2 12:34:00 UTC $(date +%Y)\n" "" ""

That said you've put more thought into this than I have and have more people
<strike>yelling at you</strike> presenting test data, so I've applied this patch
as-is and I can head-scratch over it later. (Trying to finish the tar cleanup...)

Rob



More information about the Toybox mailing list