Advertisement
ggeorgiev88

Untitled

Nov 9th, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function timeFifth(input){
  2.     let houer = Number(input[0]);
  3.     let minutes = Number(input[1]);
  4.  
  5.  
  6.   let houerToMin = houer *60;
  7.   let totalMin = houerToMin + minutes +15;
  8.  
  9.   let newHouerConv = Math.floor(totalMin /60);
  10.   let newMinCon = totalMin % 60
  11.  
  12.   if (newHouerConv === 24){
  13.     console.log(`0:${newMinCon}`)
  14.   }
  15.   else if (newMinCon < 10 ){
  16.     console.log(`${newHouerConv}:0${newMinCon}`)
  17. }
  18.  
  19.  
  20.   else  {
  21.     console.log(`${newHouerConv}:${newMinCon}`)
  22.   }
  23.  
  24.  
  25.  
  26. }
  27.  
  28. timeFifth(["23", "45"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement