It is important to note that weather and climate are terms use in forecasting meteorologically wherein these two terms are interrelated but should not be interchanged. Weather refers to the atmospheric conditions within a shorter time span whereas climate refers to the atmospheric conditions for a long span of time such as years or decades. A rainy day or a sunny day is what we call weather while a rainy season or any kind of season such as winter, spring and autumn is what we call climate.
To determine a particular weather of a particular place there are certain factors involve such as topography of the place, its geography, altitudinal elevation of a land area, latitudinal measurement from the earth’s equator, angular measurement from the rays of the sun, consistency of patterns of the winds and many others. For the weather San Francisco its geographical location at the end of a peninsula where the western region faces the Ocean of the Pacific, its eastern bay region, the northern part which is also surrounded with water and its topographical feature where its city is mostly surrounded with hills primarily contributes to its type of weather. 
Amongst the key cities of the United States of America San Francisco is said to have the coldest weather for the summer months of June, July and August. For summer season the increasingly warm wind from the valleys in the inside of California gives the place a lower pressure drawing winds from Northern Pacific to the famous San Francisco gate which gives the characteristically cool and foggy weather San Francisco. The usual annual hottest period around the end of summertime on the way to fall season the east coast of San Francisco has a lesser foggy weather. This distinctive exhibition of sub weather changes in San Francisco is because of the topographical location and the surrounding waters. The slight variation from the yearly rainy days in various areas in the city is due to the hills surrounding the city. The hills serve as protection for the eastern neighboring areas from fogs, icy cool and extremely airy making weather San Francisco sunny for most time of the year.