in Ruby, conversion of float integer into %H %M %S time -


how convert float, 13.5, corresponding 24-hour time %h:%m:%s? (13.5 13:30:00, 8.25 8:15:00) i'm still figuring time class...it confuses me

sec = (13.5 * 3600).to_i min, sec = sec.divmod(60) hour, min = min.divmod(60) "%02d:%02d:%02d" % [hour, min, sec] # => "13:30:00" 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -