def strftime(fmt)
      h = to_h
      hx = {
       'y' => h[:years]  ,
       'w' => h[:weeks]  ,
       'd' => h[:days]   ,
       'h' => h[:hours]  ,
       'm' => h[:minutes],
       's' => h[:seconds],
       't' => total,
       'x' => to_s 
      }
      fmt.gsub(/%?%(w|d|h|m|s|t|x)/) do |match|
        hx[match[1..1]]
      end.gsub('%%', '%')
    end
def strftime(fmt)
      h = to_h
      hx = {
       'y' => h[:years]  ,
       'w' => h[:weeks]  ,
       'd' => h[:days]   ,
       'h' => h[:hours]  ,
       'm' => h[:minutes],
       's' => h[:seconds],
       't' => total,
       'x' => to_s 
      }
      fmt.gsub(/%?%(w|d|h|m|s|t|x)/) do |match|
        hx[match[1..1]]
      end.gsub('%%', '%')
    end
Format duration.

 *Identifiers*

     %w -- Number of weeks
     %d -- Number of days
     %h -- Number of hours
     %m -- Number of minutes
     %s -- Number of seconds
     %t -- Total number of seconds
     %x -- Duration#to_s
     %% -- Literal `%' character

 *Example*

     d = Duration.new(:weeks => 10, :days => 7)
     => #<Duration: 11 weeks>
     d.strftime("It's been %w weeks!")
     => "It's been 11 weeks!"