# assuming $_session_time is in seconds. my $_session_time = $session{time_then}; my $_current_time = time(); my $_time_now = ($_current_time-$_session_time); my $minutes = int($_time_now / 60); my $seconds = $_time_now % 60;
Though this will likely fail during time changes if they are observed where this code is being run.
Alternatives include DateTime, Date::Calc, and Date::Manip.
Code lightly tested. "It works for me."
In reply to Re: Time Formatting....
by mpd
in thread Time Formatting....
by powerhouse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |