views:

31

answers:

1

Hi, I have a bit of a strange problem.

I'd like to be able to measure a timespan independently of the system datetime.

We basically have a system with one central server and multiple local servers which are constantly synchronising with the central server.

Objects on the central server are only valid for a specified time period, e.g. 01 October 2009 09:00 -> 01 October 2009 17:00.

An object might be downloaded to a local server months in advance of the time period in which it is valid.

When an object is downloaded to the local server it has a property on it which defines the length of time before it becomes valid.

Currently I just calculate the datetime that it will become valid on the local server from this timespan and then activate the object locally at this time.

This whole design though is flawed by the fact that someone could just put their clock forward on their local server to prematurely activate their downloaded object.

Is there no fixed point of reference that I could use on local servers to measure timespans, something that couldn't be changed??? Something like a "ticksSinceProcessorInstallation" property or something similar???

I know that I could come up with some solution that polls the central server to constantly get the time on there, but ideally the local server should be able to remain offline the whole time after initially downloading the object from the central server.

If anyone has any helpful suggestions then I'd be very appreciative,

Thanks

+1  A: 

Centralize it. If you can't centralize it with one of your own servers, query a public time server; your server admins can't change the times on those.

The fundamental principle here is that you can't control a user defined setting (the clock), so if it's this critical, it's not a reliable point of measure. Anything that measures a "duration-since-then" would need some reference to the current date/time, so you're going to have to go ask another server to get the "real deal" if you have to consider the local time invalid.

routeNpingme