Predicting the time it will take to finish a task is very difficult, even for people who have worked on those topics for years. However, writing timelines and the timelines themselves are still extremely useful even if the times they say are not trustworthy.
Like Sayam said, writing a detailed timeline forces you to divide the work in chunks and to show you are aware of all the tasks that need to be completed to finish the project. Timelines also show you understand the dependencies between such tasks (and some timeline representations like the gnatt charts bring that to the extreme), i.e. you can’t start a task before the expected end time of all the tasks it depends on.