This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a7c11d55 [LANG-1767] FastDateFormat.parse can not recgnoize "CEST" 
Timezone.
7a7c11d55 is described below

commit 7a7c11d5526082fe9667fafae045545ea7b5fc94
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Tue Mar 25 08:46:08 2025 -0400

    [LANG-1767] FastDateFormat.parse can not recgnoize "CEST" Timezone.
    
    Add test
---
 .../apache/commons/lang3/time/FastDateFormatTest.java    | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git 
a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java 
b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java
index 0ef060f6c..fa507c58a 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateFormatTest.java
@@ -18,12 +18,14 @@
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.fail;
 
 import java.text.FieldPosition;
 import java.text.Format;
+import java.text.ParseException;
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
 import java.time.Instant;
@@ -258,11 +260,11 @@ public void testLang1152() {
         dateAsString = FastDateFormat.getInstance("dd/MM/yyyy", utc, 
Locale.US).format(date);
         assertEquals("17/08/292278994", dateAsString);
     }
+
     @Test
     public void testLang1267() {
         FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
     }
-
     @Test
     public void testLang1641() {
         assertSame(FastDateFormat.getInstance(ISO_8601_DATE_FORMAT), 
FastDateFormat.getInstance(ISO_8601_DATE_FORMAT));
@@ -286,6 +288,18 @@ public void testLang954() {
         FastDateFormat.getInstance(pattern);
     }
 
+    /**
+     * Tests [LANG-1767] FastDateFormat.parse can not recgnoize "CEST" 
Timezone.
+     *
+     * @throws ParseException Throws on test failure.
+     */
+    @Test
+    public void testParseCentralEuropeanSummerTime() throws ParseException {
+        assertNotNull(FastDateFormat.getInstance("dd.MM.yyyy HH:mm:ss", 
Locale.GERMANY).parse("26.10.2014 02:00:00"));
+        assertNotNull(FastDateFormat.getInstance("dd.MM.yyyy HH:mm:ss z", 
Locale.US).parse("26.10.2014 02:00:00 CEST"));
+        assertNotNull(FastDateFormat.getInstance("dd.MM.yyyy HH:mm:ss z", 
Locale.GERMANY).parse("26.10.2014 02:00:00 MESZ"));
+    }
+
     @Test
     public void testParseSync() throws InterruptedException {
         final String pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS";

Reply via email to