Skip to content

Instantly share code, notes, and snippets.

View MuhiaKevin's full-sized avatar
🎯
Focusing

Muhia Kahiga MuhiaKevin

🎯
Focusing
  • Naivasha, Kenya
View GitHub Profile
function timeConversion(stringg){
let hour = stringg.substring(0,2)
let mins = stringg.substring(3,5)
let seconds = stringg.substring(6,8)
let timeconvention = stringg.substring(8,10)
let rest = stringg.substring(2,8)
if(timeconvention == 'PM'){
if(parseInt(hour) != 12){
let hour1 = 0
def timeConversion(stringg):
hour = stringg[:2]
mins = stringg[3:5]
seconds = stringg[6:8]
timeconvention = stringg[8:]
rest = stringg[2:8]
if int(hour) >= 1 and int(hour) <= 12 and int(mins) >= 0 and int(mins) <= 59 and int(seconds) >= 0 and int(seconds) <= 59:
if(timeconvention == 'PM'):
if(int(hour) is not 12):