Can't manage to sort a file and display time & date on a LCD screen.

I removed the RTC and the programme works! My list is sorted! How do you explain that?