How to read date time value not separated by T?

apoc

(Gaurav Jain) #1

Hi All,

I am trying to load the CSV data into Neo4J and my CSV contains datetime variable having values in the format of 15-12-2018 10:00:30 .

If I add T in between like 15-12-2018T10:00:30 then I am able to parse as Datetime in Neo4J not without adding T.

Can anyone help me how can I parse string "15-12-2018 10:00:30" as DateTime while loading this in Neo4J.

Regards
Gaurav


(M. David Allen) #2

Whether or not you have a T in the input, you should be able to use apoc.date.parse to get the job done with the right format string.

Here's the documentation:

https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_conversion_functions_between_formatted_dates_and_timestamps

(This requires that you download and install the APOC plugin into your database)


(Gaurav Jain) #3

Thanks David, I realized my mistake.

It's working now and I am able to use apoc.date.format on top of that as well.