Skip to content

Instantly share code, notes, and snippets.

@codebubb
Created September 6, 2019 12:44
Show Gist options
  • Select an option

  • Save codebubb/c3e992689b7dac51a575a55e5554a447 to your computer and use it in GitHub Desktop.

Select an option

Save codebubb/c3e992689b7dac51a575a55e5554a447 to your computer and use it in GitHub Desktop.
Get today's date in JavaScript
const today = new Date();
const dd = String(today.getDate()).padStart(2, '0');
const mm = String(today.getMonth() + 1).padStart(2, '0');
const yyyy = today.getFullYear();
const todayDate = `${dd}/${mm}/${yyyy}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment