أَخْبَرَنَا يَحْيَى بْنُ حَبِيبِ بْنِ عَرَبِيٍّ، قَالَ حَدَّثَنَا حَمَّادٌ، عَنْ بُرْدٍ، عَنْ عُبَادَةَ بْنِ نُسَىٍّ، عَنْ غُضَيْفِ بْنِ الْحَارِثِ، قَالَ دَخَلْتُ عَلَى عَائِشَةَ فَسَأَلْتُهَا فَقُلْتُ أَكَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يَغْتَسِلُ مِنْ أَوَّلِ اللَّيْلِ أَوْ مِنْ آخِرِهِ قَالَتْ كُلُّ ذَلِكَ كَانَ رُبَّمَا اغْتَسَلَ مِنْ أَوَّلِهِ وَرُبَّمَا اغْتَسَلَ مِنْ آخِرِهِ ‏‏.‏‏ قُلْتُ الْحَمْدُ لِلَّهِ الَّذِي جَعَلَ فِي الأَمْرِ سَعَةً ‏‏.‏‏

It was narrated that Ghudaif bin Al-Harith said: "I entered upon 'Aishah and asked her: 'Did the Messenger of Allah (PBUH) perform Ghusl at the beginning of the night or at the end?' She said: 'Both. Sometimes he performed Ghusl at the beginning and sometimes at the end.' I said: 'Praise be to Allah who has made the matter flexible.'" Translation Not Available

Book Ref: Sunan An Nisai Book 4 Hadith 405
Web Ref:  Sunan An Nisai Vol 1 Book 4 Hadith 405