sub dhms2sec { my $in = shift; $in =~ s/(and|,)//g; $in =~ s/(\w+)s/\1/g; my %y = reverse split(/\s+/,$in); return ($y{'second'}) + ($y{'minute'} * 60) + ($y{'hour'} * 60*60) + ($y{'day'} * 60*60*24); }
In reply to Re: How do I convert seconds into a readable time?
by zen-japh
in thread How do I convert seconds into a readable time?
by Monolith-0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |