Parsing time like '9:00AM'

Hi,

I'm looking to parse time with AM/PM format to match data after a certain hour.

How can I do that ?

Thanks for help

return time(datetime({epochMillis:apoc.date.parse("9:00AM", "ms","hh:mma")})) does the trick.
Bottom line is that standard cypher cannot parse arbitrary formats, so APOC to the rescue to parsing and returing milliseconds. Those can be passed to datetime allowing finally initializing of a time instance.

2 Likes

or if you have a space like I did
apoc.date.parse(c.createdDate + ' ' + c.createdTime, "ms", 'MM/dd/yyyy hh:mm:ss a')

1 Like