@@ -688,7 +688,7 @@ fn test_date_timezone_parsing_fix() {
688688 // Test the fix for issue #8976: dates without timezone should be interpreted as local time
689689 // This test ensures that dates like "2025-03-29 8:30:00" are interpreted as 8:30 in the
690690 // local timezone for that specific date, not as UTC converted to local time.
691-
691+
692692 fn test_tz_parsing ( tz : & str , date : & str , expected_time : & str , expected_tz : & str ) {
693693 println ! ( "Test with TZ={tz}, date=\" {date}\" ." ) ;
694694 new_ucmd ! ( )
@@ -702,23 +702,58 @@ fn test_date_timezone_parsing_fix() {
702702
703703 // Test Europe/Prague timezone (CET/CEST) - the timezone from the original issue
704704 // March 29, 2025 is in standard time (CET, UTC+1)
705- test_tz_parsing ( "Europe/Prague" , "2025-03-29 8:30:00" , "2025-03-29 08:30:00" , "CET" ) ;
706-
707- // March 30, 2025 is in daylight saving time (CEST, UTC+2)
708- test_tz_parsing ( "Europe/Prague" , "2025-03-30 8:30:00" , "2025-03-30 08:30:00" , "CEST" ) ;
709-
705+ test_tz_parsing (
706+ "Europe/Prague" ,
707+ "2025-03-29 8:30:00" ,
708+ "2025-03-29 08:30:00" ,
709+ "CET" ,
710+ ) ;
711+
712+ // March 30, 2025 is in daylight saving time (CEST, UTC+2)
713+ test_tz_parsing (
714+ "Europe/Prague" ,
715+ "2025-03-30 8:30:00" ,
716+ "2025-03-30 08:30:00" ,
717+ "CEST" ,
718+ ) ;
719+
710720 // October 25, 2025 is still in daylight saving time (CEST, UTC+2)
711- test_tz_parsing ( "Europe/Prague" , "2025-10-25 8:30:00" , "2025-10-25 08:30:00" , "CEST" ) ;
712-
721+ test_tz_parsing (
722+ "Europe/Prague" ,
723+ "2025-10-25 8:30:00" ,
724+ "2025-10-25 08:30:00" ,
725+ "CEST" ,
726+ ) ;
727+
713728 // October 26, 2025 is back to standard time (CET, UTC+1)
714- test_tz_parsing ( "Europe/Prague" , "2025-10-26 8:30:00" , "2025-10-26 08:30:00" , "CET" ) ;
715-
729+ test_tz_parsing (
730+ "Europe/Prague" ,
731+ "2025-10-26 8:30:00" ,
732+ "2025-10-26 08:30:00" ,
733+ "CET" ,
734+ ) ;
735+
716736 // Test the original issue case
717- test_tz_parsing ( "Europe/Prague" , "2031-01-26 8:30" , "2031-01-26 08:30:00" , "CET" ) ;
718-
737+ test_tz_parsing (
738+ "Europe/Prague" ,
739+ "2031-01-26 8:30" ,
740+ "2031-01-26 08:30:00" ,
741+ "CET" ,
742+ ) ;
743+
719744 // Test other timezone to ensure the fix works generally
720- test_tz_parsing ( "America/New_York" , "2025-03-29 8:30:00" , "2025-03-29 08:30:00" , "EDT" ) ;
721- test_tz_parsing ( "America/New_York" , "2025-01-15 8:30:00" , "2025-01-15 08:30:00" , "EST" ) ;
745+ test_tz_parsing (
746+ "America/New_York" ,
747+ "2025-03-29 8:30:00" ,
748+ "2025-03-29 08:30:00" ,
749+ "EDT" ,
750+ ) ;
751+ test_tz_parsing (
752+ "America/New_York" ,
753+ "2025-01-15 8:30:00" ,
754+ "2025-01-15 08:30:00" ,
755+ "EST" ,
756+ ) ;
722757}
723758
724759#[ test]
0 commit comments