angular how to format date without 0 in month

Viewed 21

How do I format the date same format as MM/dd/YYYY but with no 0 in month like , ..Thanks.

instead of 02/20/2021
it should be 2/20/2021

#currentCode
{{data.targetDate | date:'MM/dd/YYYY'}}
1 Answers

if you can use this way , i think your problem will be solved

console.log("Hello I am codewithharshad");

var date = new Date();
console.log(date.getDate()+ "-" + (date.getMonth()+1) + "-" +date.getFullYear()  )

Related