]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: date: add timezone conversion test
authorSylvestre Ledru <sylvestre@debian.org>
Sat, 14 Feb 2026 19:08:12 +0000 (20:08 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 4 Mar 2026 13:22:46 +0000 (13:22 +0000)
*tests/date/date.pl: Add the test case.
Add test case for https://github.com/uutils/coreutils/issues/10800
to verify `date -u -d '10:30 UTC-05'` converts to 15:30 UTC.

tests/date/date.pl

index fabc45fec7af1a0444c23adb981e655df6a98152..99b3adb415db1804aec8863c67715f64142ce407 100755 (executable)
@@ -368,6 +368,10 @@ my @Tests =
      ['paren-5', "-d '((nested))2026-01-05' -u +'%Y-%m-%d'",
       {OUT=>"2026-01-05"}],
      ['paren-6', "-d '((nested)2026-01-05)' +'%H:%M:%S'", {OUT=>"00:00:00"}],
+
+     # Test timezone conversion with -u -d flag
+     # "10:30 UTC-05" should convert to "15:30 UTC", not "10:30 UTC"
+     ['tz-conversion-est', "-u -d '10:30 UTC-05' +'%H:%M'", {OUT=>"15:30"}],
     );
 
 # Repeat the cross-dst test, using Jan 1, 2005 and every interval from 1..364.