lib/hackers.rb
##
# Converts a timer to human readable format:
#   timer = Timer in seconds
#
# Returns a string in the format Days:Hours:Minutes:Seconds
Converts a timer to human readable format:
timer = Timer in seconds

Returns a string in the format Days:Hours:Minutes:Seconds
Converts a timer to human readable format : timer = Timer in seconds Returns a string in the format Days : Hours : Minutes : Seconds
def timerToDHMS(timer)
        dhms = Array.new
        dhms.push("%02d" % [timer / 60 / 60 / 24])
        dhms.push("%02d" % [timer / 60 / 60 % 24])
        dhms.push("%02d" % [timer / 60 % 60])
        dhms.push("%02d" % [timer % 60])
        return dhms.join(":")
      end
def timerToDHMS ( timer ) dhms = Array . new dhms . push ( "%02d" % [ timer / 60 / 60 / 24 ] ) dhms . push ( "%02d" % [ timer / 60 / 60 % 24 ] ) dhms . push ( "%02d" % [ timer / 60 % 60 ] ) dhms . push ( "%02d" % [ timer % 60 ] ) return dhms . join ( ":" ) end
Converts a timer to human readable format:
timer = Timer in seconds
Converts a timer to human readable format : timer = Timer in seconds
timer