in reply to Time to seconds
Pretty simple stuff really, just grab what's there, do a few multiplications and your set.use strict; my $seconds = 0; my $timestr = '5H3M17S'; my ($hr,$min,$sec) = $timestr =~ /^(?:(\d+)H)?(?:(\d)+M)?(\d+)S$/; $seconds += $hr * 60 * 60 if defined $hr; $seconds += $min * 60 if defined $min; $seconds += $sec; print "seconds left to going live - $seconds";
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Time to seconds
by ariels (Curate) on Nov 15, 2001 at 20:10 UTC | |
|
Re: Re: Time to seconds
by argus (Acolyte) on Nov 15, 2001 at 20:28 UTC |