Advertisement
Mvelchev

Untitled

May 24th, 2022
806
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  *
  3.  * @param {year} a
  4.  * @param {month} b
  5.  * @param {date} c
  6.  */
  7. function solve(a, b,c){
  8.    
  9.    
  10.     const d = new Date(a, b, c);
  11.     const year = d.getFullYear(a);
  12.     const date = d.getDate(c)+1;
  13.     const month = d.getMonth(b) ;
  14.     const formatted = `${year}- ${month}- ${date}`
  15.     console.log(formatted);
  16. }
  17.  
  18.    
  19.  
  20.     solve(2016, 9, 30);
  21.     solve(2020, 3, 24);
Advertisement
RAW Paste Data Copied
Advertisement