Obtaining EXACT GMT server offset

antic

Perch
Here's an interesting question... I know we can get a server's GMT offset time for our apps, but what if the server's clock is a few minutes off the exact current time? This can be critical in some apps.

So the question is: Is there a way to use XMLHTTP or something to grab an EXACT current GMT time from a global time server in an ASP app?

If so, we can use this to account for any variability in the server's own clock setting, and therefore end up with exactly correct timestamps in our databases all the time.

Any ideas where to get "real" time from? Any atomic clocks online we can access via ASP? :)
 
wow. that would be pretty cool. i hope someone has an answer for this... probably would want to grab the GMT time from a server-side code at the start of a session instead of using xmlhttp to get it, but would be pretty neat to see this work.
 
I was thinking it could be done within the Application scope and updated every say 24 hours. That is, one App variable for the GMT time and another to keep the time of the last update.

The reason for keeping it updated is that the server's clock may slowly drift or even be *gasp* synched :) and so the difference between what the server thinks is GMT time, and what it actually is, would be kept up to date.

Whenever you want the time, you don't get it from the remote server, you just apply the #minutes difference to the server's time as worked out at the last update.
 
It would probably be easier to run some time synvhing software on the server itself rather than adjusting the time in your code. Though it would be good for the times when that isn't possible, like here.
 
Back
Top