A popular quote incorrectly attributed to Mark Twain is "The coldest winter I ever spent was a summer in San Francisco." San Francisco's climate is characteristic of the cool-summer Mediterranean climate of California’s coast, "generally characterized by moist mild winters and dry summers." Since it is surrounded on three sides by water, San Francisco's weather is strongly influenced by the cool currents of the Pacific Ocean, which moderates temperature swings and produces a remarkably mild year-round climate with little seasonal temperature variation.
Temperatures exceed 75 °F (24 °C) on average only 28 days a year. The dry period of May to October is mild to warm, with average high temperatures of 64–71 °F (18–22 °C) and lows of 51–56 °F (11–13 °C). The rainy period of November to April is slightly cooler with high temperatures of 58–64 °F (14–18 °C) and lows of 46–51 °F (8–11 °C). On average, there are 67 rainy days a year, and annual precipitation averages 20.4 inches (518.16 mm). Snow is extraordinarily rare, with only 10 instances recorded since 1852, most recently in 1976.
Among major U.S. cities, San Francisco has the coldest daily mean, maximum, and minimum temperatures for June, July and August. During the summer, rising hot air in California's interior valleys creates a low-pressure area that draws winds from the North Pacific High through the Golden Gate, which creates the city's characteristic cool winds and fog. The fog is less pronounced in eastern neighborhoods and during the late summer and early fall, which is the warmest time of the year.
Because of its sharp topography and maritime influences, San Francisco exhibits a multitude of distinct microclimates. The high hills in the geographic center of the city are responsible for a 20% variance in annual rainfall between different parts of the city. They also protect neighborhoods directly to their east from the foggy and sometimes very cold and windy conditions experienced in the Sunset District; for those who live on the eastern side of the city, San Francisco is sunnier, with an average of 260 clear days, and only 105 cloudy days per year.