The Messenger of Allah ﷺ said, "Allah, the Mighty and Majestic, has said, 'The son of Adam offends Me by cursing time, for I am time. The command is in My hand. I alternate the night and the day.'"
قال رسول الله ﷺ: قال الله عزوجل: يؤذيني ابن آدم، يسب الدهر، وأنا الدهر، بيدي الأمر أقلب الليل والنهار.
Bukhari narrated it in tafsir (4826), and Muslim in the book of expressions in etiquette and elsewhere (2246:2), both of them through the route of Sufyan, from Zuhri, from Saeed bin Musayab, from Abu Hurairah, who said, then he mentioned it, and the wording is Bukhari's.