Because Durban is characterized by a climate known as a mild subtropical one, the summers are warm but slightly wet, whereas the winters are moist or sometimes dry and frost free. So anytime you can visit Durban.
Weather wise, if you would like to spend some time on the beach without any rain, the best months to do this would be June and July as they have the least wet days, as opposed to months like October, November, December and January that have the most rainy days of the year. You will however find that a lot of people visit Durban during summer between October and January. Although it will be raining during this time, most of the days will be warm and sunny.