Is there a way via php script to sync a servers time? I have a dedicated server on a webhost and I can go in a sync it manually, but I would really rather not have to remember to do that every so often. I have read that a NTP can be setup, but I have zero knowledge of doing command line stuff like all the examples show to do. I was hoping for a php version of code that could accomplish the same thing.
The reason I need to make sure it's synced is I ran into an issue with a Google API last night that stopped allowing me to authorize cause the time Google saw was not within range of what it wanted. Once I synced the server time, it let me authorize with the API. I don't want my website to break periodically if I forget to sync the time, so an automatic sync would certainly be best.