Apoc.date cannot handle "AM" and "PM"

I have a simple time parsing:

RETURN apoc.date.parse("11:43:00", "h", "hh:mm:ss") which returns 11

and when I want to handle AM/PM I write

RETURN apoc.date.parse("11:43:00 AM", "h", "hh:mm:ss a")

but get the error:

Failed to invoke function apoc.date.parse: Caused by: java.text.ParseException: Unparseable date: "11:43:00 AM"

What am I doing wrong here?


Neo4J 4.2.1 Community Server Windows


Hi @rikku

I ran it in my environment, and it worked fine.
I changed it to PM and got 23.
Is it a problem with the Java version or something else?

macOS BigSur
Neo4j Desktop 1.4.3
Neo4j 4.2.1

Hi @rikku

I also tried it on Windows and Java11.

Windows 10 pro, 1909

It works well on Windows 10.

Hi @koji

Very much thanks for checking.
I now tried swithing java version to openjdk-11.0.2_windows-x64 . Before I was using openjdk-15.0.1_windows-x64
Still no luck and the error looks the same.