Program to find the time remaining for the day to complete | Function to find the remaining time ; Formula for total remaining minutes = 1440 - 60 h - m ; Remaining hours ; Remaining minutes ; Current time ; Get the remaining time
function remainingTime ( h , m ) { var totalMin , hoursRemaining , minRemaining ; totalMin = 1440 - 60 * h - m ; hoursRemaining = totalMin / 60 ; minRemaining = totalMin % 60 ; document . write ( Math . trunc ( hoursRemaining ) + " " + minRemaining ) ; } var h = 0 , m = 1 ; remainingTime ( h , m ) ;