Javascript add leading zeroes to date

I’ve created this script to calculate the date for 10 days in advance in the format of dd/mm/yyyy: var MyDate = new Date(); var MyDateString = new Date(); MyDate.setDate(MyDate.getDate()+10); MyDateString = MyDate.getDate() + “https://stackoverflow.com/” + (MyDate.getMonth()+1) + “https://stackoverflow.com/” + MyDate.getFullYear(); I need to have the date appear with leading zeroes on the day and month … Read more