cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

Date format conversion

How to convert the date from YYYY-MM-dd HH:mm:ss format to this YYYY-MM-dd'T'HH:mm:ssz format from neo4j .

3 REPLIES 3

Benoit_d
Graph Buddy

Therefore it should be something like:
apoc.date.convertFormat("2021-08-11 11:10:00", "YYYY-MM-dd HH:mm:ss", date_hour_minute_second_fraction)
or
apoc.date.convertFormat("2021-08-11 11:10:00", "YYYY-MM-dd HH:mm:ss", "YYYY-MM-dd'T'HH:mm:ssS")

ameyasoft
Graph Maven
Try this:

RETURN apoc.date.format(apoc.date.parse("2016-01-01 15:54:11", 's',"yyyy-MM-dd HH:mm:ss"), 's', "yyyy-MM-dd'T'HH:mm:ssz") as val
 
Result: "2016-01-01T15:54:11UTC"

Is it possible to change only the type without changing the format?

Currently save in "2016-01-01 15:54:11" format as a string {Datatype} , Expectation is 2016-01-01 15:54:11 as date {Datatype} .