parse the string (looking for the indicaters as to where the h + m bits are) and use the numbers extracted in the formula (60*hnum) + mnum.
you will need to locate the position of the h (if it exists)....and any number in the string 'located to the left' f the h should be assigned to the variable hnum.
repeat for finding the m.
take care that the mnum doesn't include the previous 'h'.
if in difficulty...post your sample code for corrections....but do have a go!