I have a date:
console.log(lastDayDate)
Output:
Sun Apr 30 2023 00:00:00 GMT-0500 (Central Daylight Time)
Then I use:
formattedDate = lastDayDate.toLocaleString().split(',')[0];
console.log(formattedDate)
Output is:
4/30/2023
How can I change it to :
04/30/2023