Parse time from float or string