Gibraltar, where it is

The climate of Gibraltar, a small British territory in southern Spain, is Mediterranean, with mild, rainy winters and warm, sunny summers. However, it has a peculiar microclimate, wet and windy, and it's protected both from the freezing cold and from the intense heat because of its location on the strait of the same name, but also because of the presence of the Rock, a promontory overlooking the city, 426 meters (1,398 feet) high.
Here are the average temperatures.
Gibraltar - Average temperatures
Min (°C)111112131517202020161312
Max (°C)161617182124272726211816
Min (°F)525254555963686868615554
Max (°F)616163647075818179706461

Precipitation amounts to nearly 800 millimeters (31.5 inches) per year, and follows the Mediterranean pattern, so it's more abundant from November to March, when it's equal to or higher than 100 mm (4 in) per month (and it can be abundant during some years), while it is very rare in summer. Here is the average precipitation.
Gibraltar - Average precipitation

The wind blows frequently: in the cold half of the year, it blows from the west, together with Atlantic depressions, while in spring and summer, in periods of good weather, the levant (easterly wind) blows, a moderate or strong wind that increases its speed when channeled into the strait. Sometimes, the wind creates a peculiar cloud on the Rock of Gibraltar, which insists especially in the central part of the city, and can also partially descend towards the plain, generating some fogs.

Cloud over the Rock of Gibraltar

Winter, from December to February, is mild, and characterized by sunny periods, but also periods of bad weather, with wind and rain. During some years, the rains can be particularly heavy or frequent. On the other hand, for its southern location, and in a peninsula surrounded by the sea, the city is protected from the cold: the temperature rarely drops below 5 °C (41 °F) at night, and it rarely remains below 10 °C (50 °F) during the day.

Spring, from March to mid-June, is mild, and gradually receives less rain and more sunshine over the weeks. In March, and sometimes in the first half of April, there may still be heavy rains. In May and June, with the arrival of good weather, the cloud above the rock often forms, so the weather remains cool and moist.

Summer, from mid-June to mid-September, is warm and sunny, but less so than in southern Spain. Typically, the temperatures are not very high, and remain below 30 °C (86 °F); the air is moist and sea breezes blow, sometimes lively. Even in July, and more rarely in August, there may be some quite cool and cloudy days, with highs around 25/27 °C (77/81 °F). Sometimes, however, the wind from Africa brings some particularly hot days, with highs about 35 °C (95 °F).

Autumn, from mid-September to November, is mild; rainy periods gradually increase. In September, there are still many warm and sunny days. By November, but sometimes also by October, we are now well into autumn, in fact, the weather is mild, but it's also often cloudy and rainy.

Cable car in Gibraltar

The amount of sunshine in Gibraltar is good in late spring and summer, from May to September, when clear skies prevail (but sometimes, as previously mentioned, the local cloud and mist can form), while it's moderate in autumn and winter, when, in addition to sunny periods, cloudy and rainy periods are possible. Here are the average sunshine hours per day.
Gibraltar - Sunshine

Given the infiltration of water from the Atlantic Ocean, the Alboran Sea near Gibraltar is not warm to swim in, and it is still very cool in June, when the water temperature is about 20 °C (68 °F), then it rises to 22 °C (72 °F) from July to September. Here are the average sea temperatures.
Gibraltar - Sea temperature
Temp (°C)161516161720222222201817
Temp (°F)615961616368727272686463

Best Time

If you want to go hiking in Gibraltar, the best time is late spring, from mid-April to mid-June. However, since it's usually not too hot in summer, you can also choose this season, bearing in mind that, if you want to combine the trip with an excursion to Andalusia, you will find intense heat, especially in inland areas (therefore, in this case, you can choose April, May and October, as we recommended for Seville). Autumn is mild, but it can be very rainy, as well as winter.
The best time for a beach holiday is summer, from June to mid-September. It's better to bring a sweatshirt or sweater for cool and windy evenings, especially in June, but for safety, also in July and August, especially if you are sensitive to cold.
Beware of monkeys, which reign supreme in the rock and steal bags from tourists.