Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/extensions/date.rb

Constant Summary collapse

SECONDS_IN_DAY =
Rational(1, 86400)

Instance Method Summary collapse

Instance Method Details

#day_fraction_to_time(fr) ⇒ Object



7
8
9
10
11
12
# File 'lib/extensions/date.rb', line 7

def day_fraction_to_time(fr)
  ss,  fr = fr.divmod(SECONDS_IN_DAY) # 4p
  h,   ss = ss.divmod(3600)
  min, s  = ss.divmod(60)
  return h, min, s, fr
end