…Sarah Bernhardt [renowned French actress] in 1886…soon shocked [Brazilian] society with her daring swimsuit and alarmed the city’s inhabitants by entering the water….At the time, Brazilians had believed a quick dip in the sea had some medical efficacy, but only around dawn before the sun became too strong and only if prescribed by a doctor. The elite cultivated their whiteness to set themselves apart from the darker-skinned lower classes To actually sit in the sun was considered declasse and a serious breach of social decorum.
…In 1917 the city established strict regulations to govern seaside conduct. Bathing in the sea was allowed only from five to eight in the morning and from five to seven in the evvening…the law permitted an extra hour on Sundays and holidays…Noise and shouting on the beach, or bathing during prohibited hours, brought a stiff fine or five days in jail.
That is from Colin MacLachlan, A History of Modern Brazil: The Past Against the Future.