Permanent Clock

Alex Martelli aleax at aleax.it
Fri Apr 25 19:44:53 EDT 2003


<posted & mailed>

Mauricio wrote:

> Is there some way of accessing a permanent clock, i.e., a clock that
> works even if the system is rebooted or poewered off?
> I would like to increment a variable each day, independent of the
> system date (once this one users can change!), but not leaving my
> script running all the time. Better explaining: every time tha script
> is run, it must now if the current day is the same of tha last time
> the script was started.If not, increment tha variable!

If your script can access the internet, it can get an accurate
date from several servers there.  (Of course, if your users are
REALLY out to screw you, they could find out which IP address
you're trying to get time from, intercept these requests, and
respond with a lie... but then, you could counter that, to some
extent, by putting up your own time server and using a challenge-
response protocol to try and validate it's the real thing... but
then, users could decompile your program, and...;-).


Alex





More information about the Python-list mailing list