Ishaq bin Abdullah bin Abi Talhah narrates that dates containing worms were given to the Messenger of Allah (peace and blessings be upon him).
(b) Ibn Umar (may Allah be pleased with them both) narrates from the Prophet (peace and blessings be upon him) the prohibition of splitting a date open (to see) what is inside it. If this is authentic, then what is meant by it, and Allah knows best, is when the dates are fresh; and what we have narrated concerns dates that are old.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصداق / 14635