Improved date parsing