The quote means that difficult or troubling times are inevitable and out of our control. All we can do is make the most of the time that we have. This is expressed by Frodo, who wishes difficult times have not come during his time, and Gandalf, who agrees and says that it isn’t up to them to decide when this time of trouble will start or end. All that remains for them to do is decide what to do with their time given to them.