TromLios Posted June 19, 2009 Share Posted June 19, 2009 I've been working on this for the last while and can't figure this out. What i'm trying to do I'm trying to compare two dates and figure out if the difference is greater than 5 seconds. The first date is retrieved from a remote file. The second date would be the localtime of the script (ran on a host so the localtime will match the host). Whats the problem The remote file is on a different server and the local time of the server is off by two minutes and a few seconds. ??? Is it possible to have a similar timestamp no matter what machine your on, like say i wanted to have all timestamps adjusted to Eastern Standard Time? Right now i'm guessing you have to get the localtime and compare the hour different to EST, then apply the difference to the localtimestamp. I'm somewhat confused and not sure how to go about all this. Quote Link to comment https://forums.phpfreaks.com/topic/162967-timestamps-and-different-computers-different-local-times/ Share on other sites More sharing options...
RussellReal Posted June 20, 2009 Share Posted June 20, 2009 send the remote server a value. send the remote server your current time.. then have the other server send back 1 value his local time, minus the difference between the request time (time it recieved the request) and the value you sent to the server example formula: (LocalTime - (requestTime - timeSentByYou)) that returned value should be VERY close to your time Quote Link to comment https://forums.phpfreaks.com/topic/162967-timestamps-and-different-computers-different-local-times/#findComment-859969 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.