date.getmonth in 2 digits code example Example: ecmascript 7 getmonth as 2 digits ("0" + (this.getMonth() + 1)).slice(-2)