Improved time parsing to ignore extra text at the end