It is narrated from Ata that the Prophet (peace and blessings be upon him) gave the herdsmen permission to perform the stoning (rami) at night.