javascript date getmonth 2 digits code example Example: get month in two digit in javascript date ("0" + (this.getMonth() + 1)).slice(-2)