More robust date parsing & formatting