Uncaught TypeError: .indexOf is not a function
Basically indexOf() is a method belongs to string(array object also), But while calling the function you are passing a number, try to cast it to a string and pass it. document.getElementById(“oset”).innerHTML = timeD2C(timeofday + “”); var timeofday = new Date().getHours() + (new Date().getMinutes()) / 60; function timeD2C(time) { // Converts 11.5 (decimal) to 11:30 (colon) … Read more