How to convert a date format [mm/DD/yy] to [yyyy/MM/dd] using APOC or Cypher

Hi Guys,

I have a CSV file where the date format is [mm/DD/yy] (for example: 7/13/19, "July 13, 2019") and I want to upload to Neo4j using [yyyy/MM/dd] (2019/13/07). Are there any APOC procedures or Cypher queries that I can use to do this?

Thank you
Yamil

Sure, you can do a parse followed by a format with APOC:

WITH "07/13/19" as input
WITH apoc.date.parse(input, 'ms', 'MM/dd/yy') as ts
RETURN apoc.date.format(ts, 'ms', 'yyyy/MM/dd')
1 Like

RETURN apoc.date.format(apoc.date.parse("July 13, 2019", 'ms', 'MMMM dd, yyyy'), 'ms', 'yyyy/MM/dd')

Result: "2019/07/13"

1 Like

Thank you guys the two answer are perfect. Both are really good solution.
Thank you so much