In books, it says December to March is the best time to visit Sri Lanka which is true as the humidity and temperature is mild (28 degrees highest to 21 degrees of Celsius lowest). Though it says it rains less in this period, we have observed this is changing along with global weather patterns. But technically December to March is the best time for Sri Lanka while July and August are also very good months.
April and May are the warmest months in Sri Lanka and the temperature could reach 35 degree of Celsius during day time and 28 degrees of Celsius in the night.
June, September and October are moderate months in temperature and ranges from minimum 25 degrees and maximum 30 degree of Celsius.
Talking about rains, it says May, June and October are rainy but this has largely now changed. So in our opinion Sri Lanka is a 12 months destination where you will find sunshine somewhere in the Island.
If you are traveling in the months of May, June, September and October you are likely to get better hotel rates as the occupancy levels drop hotels tends to throw in discounts.