How to get the correct number of days of the months in a given year

I like @TIMAI2 's solution, short and easy to understand:

2 Likes