note
aaron_baugher
<p>
In math terms, when you do a division problem, dividing gives you the quotient and taking the modulo gives you the remainder. Here, dividing a number of seconds by 3600 and dropping the decimal gives you the hours. Taking the modulo gives you the remainder of seconds:
</p>
<c>
my $s = 7209; # 2 hours and 9 seconds
my $hours = int $s/3600;
my $seconds = $s % 3600;
</c>
<div class="pmsig"><div class="pmsig-597736">
<p>Aaron B.<br />
Available for small or large Perl jobs and *nix system administration; see my home node.
</p>
</div></div>
1131293
1131293