Improved date parsing mechanism