Class: Time

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

Instance Method Summary collapse

Instance Method Details

#to_ibObject

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