N1QL Date functions with custom date format?


I have an issue I am trying to solve. I have dates stored in our database with this format:

01-21-2021 14:06:03

This is not an acceptable format to N1QL. I need to do some queries based on this timestamp. Is there a way I can make something into a date object or transform that string into something that N1QL accepts?


CONCAT(SUBSTR(endDate,6,4),"-",SUBSTR(endDate,0,2),"-", SUBSTR(endDate,3,2),"T",SUBSTR(endDate,11))

checkout Compare date data in string ("MM/dd/yyyy") with between clause