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