Pedro Carvalho Pedro Carvalho - 5 months ago 41
SQL Question

Load CSV in Neo4j and convert timestamp to long

I want to upload the data from a PostgreSQL database to a Neo4j one, and some of my rows are millisecond-precision timestamps. How do I convert them to (at least second-precision) longs when doing that (presumably with LOAD CSV)?

Answer

Milliseconds since 1970-01-01:

select round(extract(epoch from now()) * 1000)::bigint;
     round     
---------------
 1467313443460
Comments