lib/PipBot.rb
# Converts seconds to human readable format.

Converts seconds to human readable format.
Converts seconds to human readable format .
def time_in_words(time)
    days = (time / 86_400).to_i
    time -= days * 86_400
    hours = (time / 3600).to_i
    time -= hours * 3600
    minutes = (time / 60).to_i
    string = "#{days} jour#{'s' unless days == 1},"
    string << " #{hours} heure#{'s' unless hours == 1},"
    string << " #{minutes} minute#{'s' unless minutes == 1}"
  end
def time_in_words ( time ) days = ( time / 86_400 ) . to_i time -= days * 86_400 hours = ( time / 3600 ) . to_i time -= hours * 3600 minutes = ( time / 60 ) . to_i string = "#{days} jour#{'s' unless days == 1}," string << " #{hours} heure#{'s' unless hours == 1}," string << " #{minutes} minute#{'s' unless minutes == 1}" end
Converts seconds to human readable format.
Converts seconds to human readable format .
time
<not_specific>