I'm sure they can bit at any time, but there are times that you are warned not to be in te water. I live at the beach. Our news tells you all the time that high risk times are dusk and dawn. When you see bait fish jumping close to shore, stay away. It's feeding time. Never wear shiny objects in the water either. If the water is murky, or rough, try & stay out. Sharks get disorientated very easily in murky or rough water.
They don't want to bite you any more than you don't want them to.
It's usually by accident, they will mistake you for another fish.
these are clear facts. I'm not trying to be a jerk, just telling you the facts. Usually when a shark bites, one of these are the case.