The World’s Largest Online Community for Developers

'; node.js - How to read a date from a CSV in a particular format in Nodejs? - LavOzs.Com

I'm trying to read a file using csvtojson module. Date field is getting read as "05-23-2020" & next date is "23-03-2020" . Format which I should use is dd-mm-yyyy. But here in the backend if I try to convert the follwing date "23-03-2020" using

new Date("23-03-2020)

I'm getting as invalid date. But for this date "05-23-2020" , I can get the value.

How can I solve this issue?. New Date will only accept the date string in mm-dd-yyyy format. Can anyone please help me with this?

Convert UTC Epoch to local date
In Node.js, how do I “include” functions from my other files?
How can I update NodeJS and NPM to the next versions?
Is there a way to get version from package.json in nodejs code?
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
NodeJS - Convert CSV to JSON Object array
Format Date in Mongoose