Sha256: 22b8b8d160c6fc95f3bf7c7acba89d352af61cb8b0e78690dd8de48feb379dfe
Contents?: true
Size: 570 Bytes
Versions: 59
Compression:
Stored size: 570 Bytes
Contents
module Evertils module Helper class Time def self.human_readable(start, finish) seconds = finish.to_f - start.to_f if seconds < 60 "No time at all!" else minutes = (seconds / 60).round(1) if minutes < 1 "#{minutes} minute" else "#{minutes} minutes" end end end def self.formatted(time = nil) if time.nil? time = ::Time.now end time.strftime("%e/%-m/%Y @ %I:%M:%S%P") end end end end
Version data entries
59 entries across 59 versions & 1 rubygems