Jump to content

Get accurate time from webserver and sycn it with yours.


Recommended Posts

I want to sync my local servers time to remote servers. I am using cURL to communicate with remote web server and get that servers time from response header "Date: xxx. xx xxx xxxx xx:xx:xx GMT". Date header is generated before sending data back to local server so i must add the time which took remote server to upload headers to my local server.

 

I am using curl_getinfo and i get 5 numbers:

  • CURLINFO_TOTAL_TIME = 1,264
  • CURLINFO_NAMELOOKUP_TIME = 0,016
  • CURLINFO_CONNECT_TIME = 0,125
  • CURLINFO_PRETRANSFER_TIME = 0,125
  • CURLINFO_STARTTRANSFER_TIME = 1,264

 

Which of these tell me, how long did it took between saving server time into Date header and sending it to my me? Can anyone explain! Am I even on the right track or am I missing something?

 

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.