Skip to content

Instantly share code, notes, and snippets.

@nocodesupplyco
Created December 16, 2022 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nocodesupplyco/96b972ee2f0f963f8dd2a7bc8b45a8ae to your computer and use it in GitHub Desktop.
Save nocodesupplyco/96b972ee2f0f963f8dd2a7bc8b45a8ae to your computer and use it in GitHub Desktop.
Set Text to Today's Date
let today = new Date();
let day = today.getDate();
let month = today.getMonth() + 1;
let year = today.getFullYear();
if (day < 10) {
day = '0' + day
}
if (month < 10) {
month = '0' + month
}
let out = document.getElementById("output");
out.innerHTML = month + "/" + day + "/" + year;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment