class Fixnum

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)

Public Instance Methods

strftime(format) click to toggle source
# 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