On 5 September 2013 a magnitude 7.9 earthquake rocked Costa Rica. The unusual thing is that scientists were able to forecast this one. They knew that a 7.7 to 7.8 quake would occur in this area in 2000 ± 20 years. It turns out that large (> 7 magnitude) earthquakes happen on this peninsula about every 50 years. The subduction zone also is on land instead of in the ocean, so it’s much easier to study.
They started studying in 1990 using GPS stations to measure the Earth’s movement. This let geologists identify two places where the plates were locked and building up stress. Knowing this, they were able to make civil changes to improve building codes and warn the populace on what to do when a quake struck.
But forecasting is different than predicting. Predicting the actual date of an earthquake is pretty much impossible.