The simplest solutions seem to overlook that UTC time will be used, including highly up-voted ones. Below is a streamlined, ES6, non-jQuery version of a couple of existing answers:
const today = (function() { const now = new Date(); const month = (now.getMonth() + 1).toString().padStart(2, '0'); const day = now.getDate().toString().padStart(2, '0'); return `${now.getFullYear()}-${month}-${day}`; })(); console.log(today); // as of posting this answer: 2019-01-24 const today = (function() { const now = new Date(); const month = (now.getMonth() + 1).toString().padStart(2, '0'); const day = now.getDate().toString().padStart(2, '0'); return `${now.getFullYear()}-${month}-${day}`; })(); console.log(today); // as of posting this answer: 2019-01-24