Before the battle with the Kharijites someone said, "If you set out at this moment then according to astrology I fear you will not be successful in your aim," whereupon he said:
Do you think you can tell the hour when a man goes out and no evil befall him or can warn of the time at which if one goes out harm will accrue? Whoever testifies to this falsifies the Qur'an and becomes unmindful of Allah in achieving his desired objective and in warding off the undesirable. You cherish saying this so that he who acts on what you say should praise you rather than Allah because according to your misconception you have guided him about the hour in which he would secure benefit and avoid harm.
Then Ameerul Momineen advanced towards the people and said: O' People! Beware of learning the science of stars except that with which guidance is sought on land or sea, because it leads to divining and an astrologer is a diviner, while the diviner is like the sorcerer, the sorcerer is like the unbeliever and the unbeliever would be in Hell. Go forward in the name of Allah.