app/helpers/status_helper.rb in chef-server-webui-0.8.16 vs app/helpers/status_helper.rb in chef-server-webui-0.9.0.a3

- old
+ new

@@ -16,11 +16,18 @@ # limitations under the License. # require 'chef' / 'node' module Merb - module ChefServerWebui - module StatusHelper + module StatusHelper + def time_difference_in_hms(unix_time) + now = Time.now.to_i + difference = now - unix_time.to_i + hours = (difference / 3600).to_i + difference = difference % 3600 + minutes = (difference / 60).to_i + seconds = (difference % 60) + return [hours, minutes, seconds] end - + end end