Class: Fixnum
- Inherits:
-
Object
- Object
- Fixnum
- Defined in:
- lib/Common/Fixnum.rb
Overview
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])
Instance Method Summary collapse
Instance Method Details
#strftime(format) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/Common/Fixnum.rb', line 6 def strftime(format) d,r=(self.to_f).divmod(24*3600) h,r=(r).divmod(3600) m,s=(r).divmod(60) ret=String.new(format) ret.sub!("%j","#{d}") ret.sub!("%d","#{d}") ret.sub!("%h","#{h + d*24}") ret.sub!("%H","#{"%02d" % h}") ret.sub!("%M","#{"%02d" % m}") ret.sub!("%S","#{"%02d" % s.round}") ret end |