Class: Time
Instance Method Summary collapse
-
#to_ib ⇒ Object
Render datetime in IB format (zero padded “yyyymmdd HH:mm:ss”).
Instance Method Details
#to_ib ⇒ Object
Render datetime in IB format (zero padded “yyyymmdd HH:mm:ss”)
3 4 5 6 |
# File 'lib/ib/extensions.rb', line 3 def to_ib "#{year}#{sprintf("%02d", month)}#{sprintf("%02d", day)} " + "#{sprintf("%02d", hour)}:#{sprintf("%02d", min)}:#{sprintf("%02d", sec)}" end |