I am trying to write a Perl script that creates user sessions. I need to compared time/date session was created and current time/date. However, I am having trouble figuring out a way to compare the times. :mad: Here is part of the code.
@expire_date = split ' ', $session_date; # Splits date/time from Database so I can read time and date seperately.
($db_hr,$db_min,$db_sec) = split ':', $expire_date; # splits the time section from Database.
($sec,$min,$hr,$mday,$mon,$yr,$wday,$yday,$isdst) = gmtime; $hr -=4; # Gets GTM time and converts to EST time.
$current_time = sprintf("%02d:%02d:%02d GMT",$hr,$min,$sec); # Pretty print of current time
$expired = ($db_hr - $hr).":".($db_min - $min).":".($db_sec - $sec); #one thing I tried to compared the times. failed.
$newtime = $expire - $current_time; # another thing used to compared. failed