How to convert the date format '23 MAY 2022' into 25/05/2022 in javascript?
CodePudding user response:
I personally use momentjs
for your case: moment('23 MAY 2022').format("DD/MM/YYYY")
CodePudding user response:
check this out it might help: https://stackoverflow.com/a/60858473/17757846
const newDate = new Date("23 MAY 2022").toLocaleDateString("en-GB", {
year: "numeric",
month: "2-digit",
day: "2-digit",
});;