]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
date: mention military timezone changes from gnulib
authorAssaf Gordon <assafgordon@gmail.com>
Sat, 10 Aug 2019 02:16:06 +0000 (20:16 -0600)
committerAssaf Gordon <assafgordon@gmail.com>
Sun, 11 Aug 2019 03:14:20 +0000 (21:14 -0600)
Gnulib commits f1f10d47be8762e4ca17c8957a0520b08d28abfb and
0673d8ab42c9bb0cf618a21b537cdd8fb976fb73 negated the meaning of
military timezones parsed in gnu date.
See https://lists.gnu.org/r/bug-gnulib/2019-08/msg00005.html and
https://lists.gnu.org/r/coreutils/2019-08/msg00021.html

* NEWS: Mention this user-visible change.
* tests/misc/date.pl: Add tests for the new behavior.

NEWS
tests/misc/date.pl

diff --git a/NEWS b/NEWS
index 97c9d18bdfb33aff88631664ce41092bdc92401b..6719e504da08dd4326abf5a3f18b7addc477a804 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,19 @@ GNU coreutils NEWS                                    -*- outline -*-
   coherency of file system attributes, useful on network file systems.
 
 
+** Changes in behavior
+
+  date now parses military time zones in accordance with common usage:
+    "A" to "M"  are equivalent to UTC+1 to UTC+12
+    "N" to "Y"  are equivalent to UTC-1 to UTC-12
+    "Z" is "zulu" time (UTC).
+  For example, 'date -d "09:00B" is now equivalent to 9am in UTC+2 time zone.
+  Previously, military time zones were parsed according to the obsolete
+  rfc822, with their value negated (e.g., "B" was equivalent to UTC-2).
+  [The old behavior was introduced in sh-utils 2.0.15 ca. 1999, predating
+  coreutils package.]
+
+
 * Noteworthy changes in release 8.31 (2019-03-10) [stable]
 
 ** Bug fixes
index 9ba3d39839ba85906a14797c617848ad8c66f4ab..92755b1f2a4e4d9a3f8884e5334401d0537d5d7e 100755 (executable)
@@ -300,6 +300,16 @@ my @Tests =
 
      # https://bugs.gnu.org/34608
      ['date-century-plus', '-d @0 +.%+4C.', {OUT => '.+019.'}],
+
+
+     # Military time zones, new behavior (since 8.32)
+     # https://lists.gnu.org/r/bug-gnulib/2019-08/msg00005.html
+     ['mtz1', '-u -d "09:00B" +%T', {OUT => '07:00:00'}],
+     ['mtz2', '-u -d "09:00L" +%T', {OUT => '22:00:00'}],
+     ['mtz3', '-u -d "09:00N" +%T', {OUT => '10:00:00'}],
+     ['mtz4', '-u -d "09:00T" +%T', {OUT => '16:00:00'}],
+     ['mtz5', '-u -d "09:00X" +%T', {OUT => '20:00:00'}],
+     ['mtz6', '-u -d "09:00Z" +%T', {OUT => '09:00:00'}],
     );
 
 # Repeat the cross-dst test, using Jan 1, 2005 and every interval from 1..364.