Improvement on time parsing