cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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?

SETUP:

Neo4J 4.2.1 Community Server Windows

APOC 4.2.0.0-all

3 REPLIES 3

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
apoc-4.2.0.0.jar

Hi @rikku

I also tried it on Windows and Java11.

Windows 10 pro, 1909
zulu11.45.27-ca-jdk11.0.10-win_x64
neo4j-community-4.2.1
apoc-4.2.0.0-all.jar

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.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online