Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ private static final class ISO8601TimeZoneStrategy extends PatternStrategy {
// Z, +hh, -hh, +hhmm, -hhmm, +hh:mm or -hh:mm

private static final Strategy ISO_8601_1_STRATEGY = new ISO8601TimeZoneStrategy("(Z|(?:[+-]\\d{2}))");

private static final Strategy ISO_8601_2_STRATEGY = new ISO8601TimeZoneStrategy("(Z|(?:[+-]\\d{2}\\d{2}))");

private static final Strategy ISO_8601_3_STRATEGY = new ISO8601TimeZoneStrategy("(Z|(?:[+-]\\d{2}(?::)\\d{2}))");
/**
* Factory method for ISO8601TimeZoneStrategies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -747,5 +747,27 @@ private void validateSdfFormatFdpParseEquality(final String formatStr, final Loc
}
}
}

// Test case for # PR1543
@Test
public void testISO8601TimezoneVariants() throws Exception {
final FastDateParser parserWithColon =
new FastDateParser(
"yyyy-MM-dd'T'HH:mm:ssXXX",
TimeZone.getTimeZone("UTC"),
Locale.US
);

final FastDateParser parserWithoutColon =
new FastDateParser(
"yyyy-MM-dd'T'HH:mm:ssXX",
TimeZone.getTimeZone("UTC"),
Locale.US
);


parserWithColon.parse("2025-01-01T10:00:00+05:30");
parserWithoutColon.parse("2025-01-01T10:00:00+0530");
}
}