The great-circle distance is ~12,500 nautical miles. At a typical service speed of 20 knots (23 mph), a container vessel takes approximately 52 days port-to-port.
Actual transit varies due to:
Most Asia–USWC services run 21–28 day cycles; Shanghai–SF direct is typically 18–22 days at full speed, but scheduled transit including port dwell is 4–6 weeks.