more reliable date parsing