Crossing dateline function.