Portable date parsing algorithm that works in Safari.