How do I get Month and Date of JavaScript in 2 digit format? September 19, 2022 by Tarik ("0" + this.getDate()).slice(-2) for the date, and similar: ("0" + (this.getMonth() + 1)).slice(-2) for the month.