Prodanoff

time+15(1)

Feb 12th, 2020
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function time15 (input)
  2. {
  3.     let chas = Number(input.shift());
  4.     let minuti = Number(input.shift());
  5.     if ( minuti <= 44)
  6.     {
  7.         let minuti15= minuti +15;
  8.         console.log(`${chas}:${minuti15}`)
  9.     }
  10.     else{
  11.     let chasmin= chas*60;
  12.     let obshtomin = chasmin+ minuti+15;
  13.     novchas = Math.floor(obshtomin/60);
  14.     novmin = (obshtomin % 60 );
  15.     if (novmin<10)
  16.     {
  17.         if (novchas>=24){
  18.         novchas = 0
  19.         }
  20.        
  21.  
  22.         console.log(`${novchas}:0${novmin}`)
  23.     }
  24.     else{
  25.         if (novchas>=24){
  26.             novchas = 0
  27.             }
  28.     console.log(`${novchas}:${novmin}`);
  29.     }
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment