(40) The Book Concerning the Use of Correct Words
كتاب الألفاظ من الأدب وغيرها
(1) Chapter: The Prohibition Of Cursing Time
(1) باب النَّهْىِ عَنْ سَبِّ الدَّهْرِ، ‏‏
Sahih Muslim 2246 e 

Abu Huraira reported Allah's Apostle (ﷺ) as saying:

Do not curse Time, for it is Allah Who is Time.
وَحَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا جَرِيرٌ، عَنْ هِشَامٍ، عَنِ ابْنِ سِيرِينَ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ لاَ تَسُبُّوا الدَّهْرَ فَإِنَّ اللَّهَ هُوَ الدَّهْرُ ‏"‏ ‏.‏
Reference : Sahih Muslim 2246e
In-book reference : Book 40, Hadith 5
USC-MSA web (English) reference : Book 27, Hadith 5584
  (deprecated numbering scheme)