getToday.js 272 B

123456789101112
  1. /**
  2. * getToday
  3. */
  4. module.exports = function() {
  5. const today = new Date();
  6. const month = (`0${today.getMonth() + 1}`).slice(-2);
  7. const day = (`0${today.getDate()}`).slice(-2);
  8. const dateString = `${today.getFullYear()}/${month}/${day}`;
  9. return dateString;
  10. };