The eclipse prayer is prescribed when one sees an eclipse
There are saheeh ahaadeeth according to which the Messenger of Allaah (peace and blessings of Allaah be upon him) enjoined offering the eclipse prayer and reciting dhikr and du’aa’s when the Muslims see an eclipse of the sun or the moon. The Prophet (peace and blessings of Allaah be upon him) said: “The sun and the moon are two of the signs of Allaah and they do not become eclipsed for the death or birth of anyone. But Allaah sends them to make His slaves fear (Him), so if you see that, then pray and make du’aa’ until it is over.” According to another version he said: “So if you see that, then hasten to remember Allaah and call upon Him and seek His forgiveness.” So he (peace and blessings of Allaah be upon him) connected the command to pray, make du’aa’, remember Allaah and pray for forgiveness to actual sighting of the eclipse and not to the reports of the astronomers.
What all the Muslims must do is adhere to the Sunnah and act in accordance with it, and to beware of everything that is contrary to it.
Hence we know that those who offer the eclipse prayer on the basis of astronomers’ reports are making a mistake and going against the Sunnah.
It should also be noted that it is not prescribed for the people who live in a country where the eclipse is not happening to offer the prayer, because the Messenger (peace and blessings of Allaah be upon him) connected the command to pray etc to actual sighting of the eclipse, not to news from astronomers that an eclipse was going to happen, or to its happening in another country. Allaah says (interpretation of the meaning):
“And whatsoever the Messenger (Muhammad) gives you, take it; and whatsoever he forbids you, abstain (from it)”
“Indeed in the Messenger of Allaah (Muhammad) you have a good example to follow”
When the Prophet (peace and blessings of Allaah be upon him) offered the eclipse prayer, when that happened in Madeenah and the people saw it, Allaah said (interpretation of the meaning):
“And let those who oppose the Messenger’s (Muhammad’s) commandment (i.e. his Sunnah legal ways, orders, acts of worship, statements) (among the sects) beware, lest some Fitnah (disbelief, trials, afflictions, earthquakes, killing, overpowered by a tyrant) should befall them or a painful torment be inflicted on them”
It is known that he was the most knowledgeable and most sincere of people, and that he was the one who conveyed the rulings from Allaah. If it was prescribed to offer the eclipse prayer on the basis of astronomers’ reports, or when an eclipse occurs in another region that is only seen by the local inhabitants, then he would have said so and would have guided his ummah to do that. Since he did not say that, rather he said the opposite, and he told his ummah to base their actions on actual sighting of the eclipse, we know from that that this prayer is only prescribed for those who see the eclipse and in whose land it occurs. And Allaah is the Source of strength.