my $s = 7209; # 2 hours and 9 seconds my $hours = int $s/3600; my $seconds = $s % 3600;