Improved date parsing and output