In the name of God, the Merciful, the Compassionate
The Last Hour has drawn near, and the moon has split. But whenever they see a sign, they turn away and say, ‘This is evident magic.’ (54:1-2)
The miracle of the splitting of the moon was demonstrated before a certain gathering who persisted in denial of Muhammad’s Prophethood. As was related by ‘Adbullah ibn Mas‘ud, while they were in Mina’ one night, the Prophet split the moon into two by a gesture of his index finger. The halves of the moon appeared one behind the mountain and the other in front of it. Then, the Prophet turned to us and said: ‘Be witnesses!’ 
The Qur’an refers to this miracle in the following verses:
The Last Hour has drawn near, and the moon has split. But whenever they see a sign, they turn away and say, ‘This is evident magic’. (al-Qamar, 54.1-2)
Some say ‘If the splitting of the moon had taken place, it would have been known to the whole world and related in all subsequent books of human history’.
Answer: The splitting of the moon was demonstrated before a certain gathering who contradicted the Prophet Muhammad in his cause as an evidence of his Prophethood. It happened momentarily at a time of night. Also, there were obstacles which prevented the others from seeing it, such as mist, clouds and time-differences between different parts of the world. Besides, at that time science and civilization were not yet well advanced and not widespread, and, therefore, the observation of the sky was limited. There was nothing to necessitate that it should have been seen all over the world.
Interested in this ridiculous nonsense? Here’s more from Islam answers
More Mohammedan Absurdites: Islam Comic Book