http://search.cpan.org/author/MSERGEANT/Time-Object-1.00/Seconds.pm
that can do it too.
-Original Message-
From: Rob [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 1:19 PM
To: [EMAIL PROTECTED]
Subject: hours minutes and seconds in seconds
I'm working on a script that parses a log file which gives
connection time
in seconds. Below is how I resolved the problem but I think
there must be
a better way?
#!/usr/bin/perl -w
use strict;
my $sessionTime = 4000;
my $hour = $sessionTime / 3600;
my $hr = int($hour);
$sessionTime = $sessionTime - ($hr * 3600);
my $minute = $sessionTime / 60;
my $min = int($minute);
my $sec = $sessionTime - ($min * 60);
print $hr hour $min minutes and $sec seconds.\n
Rob
Good judgement comes from experience, and experience -
well, that comes from poor judgement.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]