How best to change all current isostring values to datetime with cypher

Hi, currently i have about 30 grandchild (two connections deep from root) nodes that have values that are dates as isostrings and i need to wrap all of them with datetime(). i was thinking of querying for all of them, then re-saving them wrapped in datetime(), but is there a better way? maybe a way to do it in one cypher instead of a multistep process?

With APOC library you can convert iso date format to date format.

Here is the Cypher script with iso date "2011-08-12T20:17:46.384Z"

RETURN"2011-08-12T20:17:46.384Z", 'ms', 'yyyy-MM-dd'), 'ms', 'MM-dd-yyyy')

Result: "08-12-2011"

1 Like