method
delta_to_dhms
Ruby latest stable (v2_5_5)
-
0 notes -
Class: Delta
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180 (0)
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
delta_to_dhms(delta)
public
Hide source
# File lib/date/delta.rb, line 111 def self.delta_to_dhms(delta) fr = delta.imag.abs y, fr = fr.divmod(12) m, fr = fr.divmod(1) if delta.imag < 0 y = -y m = -m end fr = delta.real.abs ss, fr = fr.divmod(SECONDS_IN_DAY) # 4p d, ss = ss.divmod(86400) h, ss = ss.divmod(3600) min, s = ss.divmod(60) if delta.real < 0 d = -d h = -h min = -min s = -s end return y, m, d, h, min, s, fr end