I have to return date from string(which is of format dd/mm/YYYY) in mongodb. My code :
db.system.js.save({
_id:"testdate",
value:function(stringDate){
return new Date(Date.parseDate(stringDate,'d/m/Y'))
}
}) ;
I am getting exception as Date.parseDate is not a function. Is there any other way to convert string to date?