Jump to content

TimeStamps and different computers, different local times


TromLios

Recommended Posts

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.

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.