[tz] [PROPOSED] Fix 0.5 s bug for Jakarta in 1923

Paul Eggert eggert at cs.ucla.edu
Mon Feb 5 08:09:31 UTC 2018


* ziguard.awk: Fix bug for Asia/Jakarta: the 1923-12-31
transition was off by 0.5 s when fractional seconds were
enabled.
---
 ziguard.awk | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/ziguard.awk b/ziguard.awk
index 795b4ef..70376b7 100644
--- a/ziguard.awk
+++ b/ziguard.awk
@@ -38,6 +38,8 @@ BEGIN {
   frac["7:07:12"] = "7:07:12.5" # Asia/Jakarta before 1923
   frac["7:36:42"] = "7:36:41.7" # Asia/Hong_Kong before 1904
   frac["8:05:43"] = "8:05:43.2" # Asia/Shanghai before 1901
+
+  fract["23:47:12"] = "23:47:12.5" # Asia/Jakarta 1923-12-31 transition
 }
 
 /^Zone/ { zone = $2 }
@@ -61,7 +63,7 @@ outfile != "main.zi" {
     }
   }
 
-  # Add or remove fractional seconds as needed.
+  # Add or remove fractional seconds as needed in UT offsets.
   f = $1 == "Zone" ? 3 : 1
   for (rounded in frac) {
     original = frac[rounded]
@@ -69,6 +71,13 @@ outfile != "main.zi" {
       $f = vanguard ? original : rounded
     }
   }
+  # Likewise for transition times.
+  for (rounded in fract) {
+    original = fract[rounded]
+    if ($(f + 6) == rounded || $(f + 6) == original) {
+      $(f + 6) = vanguard ? original : rounded
+    }
+  }
 }
 
 # If a Link line is followed by a Zone line for the same data, comment
-- 
2.14.3



More information about the tz mailing list