lib/mcgill/vsb.rb
# VSB encodes time as the number of minutes since midnight
# This function converts it to the more human readable hour:min am/pm
VSB encodes time as the number of minutes since midnight
This function converts it to the more human readable hour:min am/pm
VSB encodes time as the number of minutes since midnight This function converts it to the more human readable hour : min am / pm
def format_time(minutes)
      hour = minutes.to_i / 60
      min = "%02d" % (minutes.to_i % 60)
      if hour > 12
        hour -= 12
        ampm = 'PM'
      elsif hour == 12
        ampm = 'PM'
      else
        ampm = 'AM'
      end
      "#{hour}:#{min} #{ampm}"
    end
def format_time ( minutes ) hour = minutes . to_i / 60 min = "%02d" % ( minutes . to_i % 60 ) if hour > 12 hour -= 12 ampm = 'PM' elsif hour == 12 ampm = 'PM' else ampm = 'AM' end "#{hour}:#{min} #{ampm}" end
VSB encodes time as the number of minutes since midnight
This function converts it to the more human readable hour:min am/pm
VSB encodes time as the number of minutes since midnight This function converts it to the more human readable hour : min am / pm
minutes
<not_specific>