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.

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.