Class: Time

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

Instance Method Summary collapse

Instance Method Details

#to_ibObject

Render datetime in IB format (zero padded “yyyymmdd HH:mm:ss”)



27
28
29
30
# File 'lib/extensions/class-extensions.rb', line 27

def to_ib
  "#{year}#{sprintf("%02d", month)}#{sprintf("%02d", day)} " +
      "#{sprintf("%02d", hour)}:#{sprintf("%02d", min)}:#{sprintf("%02d", sec)}"
end