Hi all. I'm using LOAD CSV to read CSV files and append regular Cypher statements to create or update the data as a graph. One of the columns withinh the CSV source has date values formated as 'yyyy-MM-dd'. I want to transform them from string into datetime, and, at the same time, into dd/MM/yyyy format when importing into my Neo4j database. Is there any solution with LOAD CSV?
Pass the row's date string into apoc.date.parse to convert it to a workable format, e.g milliseconds:
with apoc.date.parse(row['date'], 'ms', 'yyyy-MM-dd') as evenTs
and then use apoc.date.format to put that value into the format you want:
return apoc.date.format(eventTs, 'ms', 'dd/MM/YYYY')