def ms_to_hh_mm_ss(number)
seconds = "%02d" % (number % 6)
minutes = "%02d" % ( (number / 60000 ) % 60)
hours = "%02d" % ( (number / 3600000) % 24)
return (hours + minutes + seconds).scan(/../).join(':')
end
Place this in the applications_helper.rb to make it available everywhere in the application.
No comments:
Post a Comment