daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const getToday = () => {
  2.   const d = new Date();
  3.   const year = d.getFullYear();
  4.   const month = () => {
  5.     if((d.getMonth() + 1).length === 1) {
  6.       return d.getMonth() + 1;
  7.     }
  8.     else {
  9.       return '0' + (d.getMonth() + 1)
  10.     }
  11.   };
  12.   const day = d.getDate();
  13.   const today = `${year}-${month()}-${day}`;
  14.   return today;
  15. };
  16. const today = getToday();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top