San Francisco's last slate-cleaning came in 1906, though parts of the city were constructed far more recently. The 1989 earthquake (nearly 100 km distant and comparatively mild (6.9, as opposed to an 8 or 9 mag such as the 1906 quake) still caused significant structural damage throughout San Francisco, though major damage was limited to a few neighborhoods and specific buildings -- more major damage was concentrated largely to the south, closer to the epicenter.
Most of Tokyo was destroyed during WWII, and has been rebuilt since. Japan also experiences frequent powerful earthquakes (several M8+ quakes are noted by the USGS: http://earthquake.usgs.gov/earthquakes/world/historical_coun...), effectively requiring more robust building standards. Though my understanding is that there's a great deal of collaboration between Japanese and Californian engineers on this work.