Starfleet vessels can synchronize their internal chronometers with a Federation time beacon. This was mostly done when the Captain, or other bridge officers for that matter, suspected the starship's chronometers were not displaying the correct time.
The USS Enterprise-D used a time beacon after they managed to break free of a causality loop, to determine the amount of time they had spent inside it. It turned out the Enterprise was inside the loop for 17.4 days. (TNG: "Cause and Effect")