Posted on 2003-02-25
I have a list of session ids with timestamps (using the Perl time function). I want the sessions to expire if they have lasted longer than two hours. So, I have a cron job that runs every two hours: It gets the current timestamp (using the time function). Then for each session id, it calculates the difference between the session's timestamp and the current timestamp. If the hours difference > 2, then I kill the session. Calculating this time difference is my biggest problem. How do I do this? What is the format of the time function? Is there a Perl function that can convert the timestamp to all minutes or all hours? Please help!