Removing Time::ParseDate requirement with a better sort code block