Contact: aviboots(AT)netvision.net.il
43,888 questions
57,280 answers
573 users
function getMonth2DigitsFormat(date : any) : any { const month = date.getMonth() + 1; if (month < 10) { return '0' + month; } return month; } const date = new Date('May 27, 2022 08:13:05'); console.log(getMonth2DigitsFormat(date)); /* run: "05" */