Djibouti has two seasons: unbearably hot and merely very hot.
The cool season runs from October to April, with the mildest months being December through February. Daytime temperatures in the capital hover around 29°C (84°F), dropping to a pleasant 22°C at night. This is the only comfortable time for sightseeing, hiking, and visiting inland sites like Lake Assal and Lac Abbe, where shade is nonexistent.
The hot season from May to September is genuinely extreme. Temperatures regularly exceed 40°C (104°F), and the combination of heat and humidity in Djibouti City is punishing. July is the worst, with highs above 42°C. Traveling inland during these months is inadvisable without serious preparation. Even locals slow down.
Whale shark season runs from November to February in the Gulf of Tadjoura, overlapping neatly with the best weather. If swimming with whale sharks is your reason for visiting, aim for December or January.
Diving is good year-round thanks to warm sea temperatures (26-31°C), though visibility is best in the cooler months.
Rain is rare — Djibouti receives less than 150mm per year, mostly in brief, sporadic downpours between October and March. When rain does come, the dry wadis can flash-flood, briefly making some roads impassable.
In short: visit between November and February. The rest of the year, Djibouti will test your tolerance for heat.