Module: Wwwtf::UtilsTime

Defined in:
lib/wwwtf/utils/time.rb

Class Method Summary collapse

Class Method Details

.hours_until_now(time) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/wwwtf/utils/time.rb', line 6

def self.hours_until_now(time)
  begin
    (Time.now - Time.parse(time)).to_i / 3600
  rescue
    msg = time.nil? ? 'NIL Times' : "Bad Times #{time}"
    puts "This app has seen #{msg}"
    exit 1
  end
end