time conversion javascript code example Example: time conversion in javascript let hour = s.substring(0, 2) * 1;let timeFormat = s.substring(2,8);