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