You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2023/11/16 15:22:00 UTC
[jira] [Created] (LANG-1718) FastDateFormat.getTimeInstance(FastDateFormat.SHORT, Locale.US) uses incorrect separator on JDK21
Konrad Windszus created LANG-1718:
-------------------------------------
Summary: FastDateFormat.getTimeInstance(FastDateFormat.SHORT, Locale.US) uses incorrect separator on JDK21
Key: LANG-1718
URL: https://issues.apache.org/jira/browse/LANG-1718
Project: Commons Lang
Issue Type: Bug
Components: lang.time.*
Affects Versions: 3.13.0
Reporter: Konrad Windszus
The following code piece fails with a ParseException on JDK 21.0.1 but succeeds with JDK 17.0.7 (and earlier)
{code}
FastDateFormat dateFormat = FastDateFormat.getTimeInstance(FastDateFormat.SHORT, Locale.US);
dateFormat2.parse("11:00 AM");
{code}
The reason for that is that the dateFormat.pattern with JDK21 is
{{{[104, 0, 58, 0, 109, 0, 109, 0, 47, 32, 97, 0]}}}
while with JDK 17 it is
{{{[104, 58, 109, 109, 32, 97]}}}
Notice the difference in the separator between the time and the am/pm!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)