js how to return date.getFullYear date.getMonth without slashes or spaces code example Example: get month in two digit in javascript date ("0" + (this.getMonth() + 1)).slice(-2)