so I ran into this little problem and I don't know how to solve it. I have two dates, one that comes from a Python script that arrives as a String, and one that comes from a MongoDB object. I need to compare them but the date coming from MongoDB seems to have a strange format that doesn't allow me to do so. This is an example of the dates formats:
String: 29/12/22 15:00
Object: Wed Dec 28 2022 15:00:00 GMT+0100 (hora estándar de Europa central)
From this I can easily transform the String coming from Python to a Date object, but what should I do with the MongoDB object to be able to compare them?
Dateobject and you don't need to convert it. "Wed Dec 28 2022 15:00:00 GMT+0100 (hora estándar de Europa central)" is just the way how your terminal displays it.console.log(typeof date2)results onObjecttypeof new Date()also returnsObject