Fixed bug in ConvertTime function, substring was attempting to access index out of bounds