Advertisement
Guest User

Next Day JS

a guest
Feb 28th, 2020
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. function solve(year, month, day) {
  2. let thisDay = new Date(year, month -= 1, day += 1);
  3.  
  4. let newYear = thisDay.getFullYear();
  5. let newMonth = thisDay.getMonth();
  6. let newDate = thisDay.getDate();
  7.  
  8. console.log(`${newYear}-${newMonth + 1}-${newDate}`);
  9. }
  10.  
  11. solve(2018, 2, 28);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement