It is also said of other animals, but it is not true. Undoubtedly the animals have more developed senses than ours and could therefore feel the sounds caused by the slight tremors that precede the real earthquake, or small local variations of magnetism, or even sniff small amounts of gas (such as radon) released by the movements of the rocks (See the earthquake clouds).

All about earthquakes

Follow all the scientific news on earthquakes

However, these abnormal behaviors have always been reported after the earthquake.

The only case actually documented is the one that occurred in August 2011 during the earthquake that hit the east coast of the United States.

Animals with the seismograph
At the Smithsonian's National Zoological Park in Washington, several unusual animal behaviors were documented in the minutes prior to the earthquake.
Between 5 and 10 seconds before the earthquake, many monkeys abandoned their food and climbed the trees. Even the flamingos seemed to have noticed something: they gathered in a group just before the earth began to tremble and remained close for the duration of the earthquake.
(Earthquakes? Someone appreciates them)
More incredible is the behavior of the lemurs, in particular the various reds (Varecia rubra) that have sounded the alarm 15 minutes before the earthquake. Alarm they repeated just before the earth vibrated.
And again, an elephant hid and, after the earthquake, refused to go out to eat.
Also read :
How is the depth of earthquakes determined?
Why do earthquakes occur almost always at night?
What to do in the event of an earthquake
The seismograph that hisses