Is it possible to measure the time interval that can span multiple computer restarts that do not use the DateTime class?
I have a slightly weird problem.
I would like to be able to measure a span of time regardless of the system time and time.
Basically we have a system with one central server and several local servers that are constantly in sync with the central server.
Objects on a central server are only valid for a certain period of time, for example. 01 October 2009 09:00 → 01 October 2009 17:00.
The object can be uploaded to the local server one month before the time period in which it is valid.
When an object is uploaded to the local server, it has a property on it that determines the length of time before it becomes valid.
Currently I am just calculating the datetime that it will become valid on the local server from that time frame, and then activating the object locally at that time.
This whole construct, however, is flawed in that someone could simply put their clock forward on their local server to prematurely activate their loaded object.
Isn't there a fixed point of reference that I could use on local servers to measure time intervals that couldn't be changed ??? Something like "ticksSinceProcessorInstallation" property or something like that ???
I know I can come up with some solution that polls the central server to get the time there all the time, but ideally the local server should remain offline all the time after the initial download of the object from the central server.
If anyone has any helpful suggestions I would be very grateful,
thank
Centralize it. If you cannot centralize it with one of your own servers, ask for a public time server; your server administrators cannot change the time on them.
The basic principle is that you cannot control the custom setting (clock), so if it is a critical value it is not a reliable measuring point. Anything that measures "duration since" will require some reference to the current date / time, so you have to go to another server to get the "real deal" if you need to count the local time as invalid.
source to share