Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Formatting elapsed time

by Hofmator (Curate)
on Sep 06, 2001 at 17:34 UTC ( #110568=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        $res .= sprintf "%dw", $weeks   if $weeks;
        $res .= sprintf "%dd", $days    if $days;
        $res .= sprintf "%dh", $hours   if $hours;
        $res .= sprintf "%dm", $minutes if $minutes;
        $res .= sprintf '%ds', $seconds;
    
  2. or download this
     $res .= sprintf "%dw", $weeks   if                                $we
    +eks;
     $res .= sprintf "%dd", $days    if                       $days or $we
    +eks;
     $res .= sprintf "%dh", $hours   if             $hours or $days or $we
    +eks;
     $res .= sprintf "%dm", $minutes if $minutes or $hours or $days or $we
    +eks;
     $res .= sprintf '%ds', $seconds;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://110568]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2014-10-21 01:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (94 votes), past polls