in reply to Perl reading clock changes

I'm not sure what are you asking about, but here's my guess.

maybe you can keep track, in a seperate log file, of the current time, and when you next check the time, it should be higher that the previous - already logged - by a certain amount of (minutes|milliseconds|years)... if not, then the user has changed his clock.


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

Replies are listed 'Best First'.
(cLive ;-) Re: Perl reading clock changes
by cLive ;-) (Prior) on Feb 05, 2002 at 07:52 UTC
    And to add (because you're a newbie) to chady's reply, you need to store somewhere the value of the "time" function, eg:
    # snippet... open(TIMELOG,">timelog.txt") || die $!; print TIMELOG time; close(TIMELOG);
    then when you need to see if clock has been set back:
    open(TIMELOG,"<timelog.txt") || die $!; my $stored_time = <TIMELOG>; close(TIMELOG); if (time < $stored_time) { ... do something because time now is earlier than stored }
    .02

    cLive ;-)