Results 1 to 6 of 6

Thread: Determine Time on Someone Else’s Web Server

  1. #1

    Thread Starter
    Hyperactive Member rjbudz's Avatar
    Join Date
    Jul 2005
    Location
    San Diego
    Posts
    262

    Determine Time on Someone Else’s Web Server

    Hi,

    I want to be able to check the time on a web server (not my own) to launch browsers (and pages on that site) at a specific time, according to THAT server's clock.

    There IS a way to do it:

    1) Use URLDownloadToFile API to download the page source code from the home page (which has a clock on it), this API writes the text to a file.

    2) Open said file, find the tags that surround the time text, use Mid() to extract the value.

    3) Determine the difference (in seconds) between the two times.

    4) Using a timer, update using my system's time plus the difference.

    That's seems pretty round-about. Who knows how much lag-time could occur. Then there is also a problem using DateAdd() when the server time hits midnight. The DateAdd() result keeps the PM and sets the hour to zero-one ( i.e., “01:00:00 PM” rather than 00:00:00 AM). But that's a secondary issue.

    Is there a more efficient way of obtaining and maintaining the server's time? Milliseconds are not important, but seconds are.

    Keep in mind that some of my users will still be using dial-up. IF there is a way to ping the server regularly for its time, will there be a dramatic hit on bandwidth?

    Suggestions, please?

  2. #2

    Thread Starter
    Hyperactive Member rjbudz's Avatar
    Join Date
    Jul 2005
    Location
    San Diego
    Posts
    262

    Re: Determine Time on Someone Else’s Web Server

    This seems like it would be a relatively easy thing to do. Someone must know how to do it.

    So I'm bumping it.

  3. #3

    Thread Starter
    Hyperactive Member rjbudz's Avatar
    Join Date
    Jul 2005
    Location
    San Diego
    Posts
    262

    Re: Determine Time on Someone Else’s Web Server

    I really could use some help with this. Anyone out there?

  4. #4
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006
    Posts
    324

    Re: Determine Time on Someone Else’s Web Server

    Here are two links that show you two different methods, the first uses SNTP protocol, the second HTTP protocol.

    Link #1: http://vbnet.mvps.org/index.html?cod...cksynctime.htm

    Link #2: http://brigsoft.com/atomic-clock-syn...cVbArticle.htm

  5. #5
    Member
    Join Date
    Mar 2005
    Location
    Marlborough, MA
    Posts
    53

    Re: Determine Time on Someone Else’s Web Server

    You can use NetRemoteTOD API to get server time info

  6. #6

    Thread Starter
    Hyperactive Member rjbudz's Avatar
    Join Date
    Jul 2005
    Location
    San Diego
    Posts
    262

    Re: Determine Time on Someone Else’s Web Server

    NetRemoteTOD seems to only work on NT servers within your network, not for servers on the Internet. Link #2 appears to only read Universal Time from an atomic clock site. Apparently it (the site) is sent up to supply the time when asked for. In my case, I don't have that luxury.

    I'm still looking into Link #1 though it appears to have the same limitation as Link #2.

    Thanks for looking into this form me. Ideas and/or clarification is appreciated!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width