Pedro Carvalho Pedro Carvalho - 1 year ago 124
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 Source

Milliseconds since 1970-01-01:

select round(extract(epoch from now()) * 1000)::bigint;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download