Ashwin
Ashwin

Reputation: 7647

Neo4j formatting timestamp() epoch to datetime without using apoc plugin

Is there a way in Neo4j to format epoch value saved using timestamp() function as "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'" without using the apoc plugin?

Upvotes: 2

Views: 1648

Answers (2)

borcho
borcho

Reputation: 137

Do not know if this might be useful for somebody but I ended using:

datetime({ epochSeconds:toInteger(VALUE)})

Since using the alternative proposed by Avenger789 was throwing an error.

Upvotes: 1

Avenger789
Avenger789

Reputation: 402

You can use the datetime features of Neo4J to do this. Example below:

RETURN datetime({ epochSeconds:1562735372 }) AS theDate

Or using the timestamp()

RETURN datetime({ epochSeconds:timestamp()/ 1000, nanosecond: 23 }) AS theDate

Upvotes: 3

Related Questions