const formatDate = date => { return ( date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() ); }; console.log(formatDate(new Date()));