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 e67a2947b Add FastDateParserTest.testISO8601TimeZoneVariants()
e67a2947b is described below
commit e67a2947b7e387941f109d863d0e7e420adc6976
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jan 17 08:23:11 2026 -0500
Add FastDateParserTest.testISO8601TimeZoneVariants()
See PR ##1543
---
.../java/org/apache/commons/lang3/time/FastDateParserTest.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git
a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
index c8b9099a2..14e3137e1 100644
--- a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java
@@ -29,6 +29,7 @@
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
+import java.time.Instant;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
@@ -351,6 +352,14 @@ void testEquals() {
assertNotEquals(parser1, new Object());
}
+ @Test
+ void testISO8601TimeZoneVariants() throws Exception {
+ final Date date = Date.from(Instant.parse("2026-01-17T04:30:00Z"));
+ final TimeZone timeZone = TimeZone.getTimeZone("UTC");
+ assertEquals(date, new FastDateParser("yyyy-MM-dd'T'HH:mm:ssXXX",
timeZone, Locale.US).parse("2026-01-17T10:00:00+05:30"));
+ assertEquals(date, new FastDateParser("yyyy-MM-dd'T'HH:mm:ssXX",
timeZone, Locale.US).parse("2026-01-17T10:00:00+0530"));
+ }
+
@Test
void testJpLocales() {