Class: DateTime
- Inherits:
-
Object
- Object
- DateTime
- Defined in:
- lib/ofx/1.0.2/serializer.rb
Instance Method Summary collapse
Instance Method Details
#to_ofx_102_s(extended = true) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/ofx/1.0.2/serializer.rb', line 104 def to_ofx_102_s(extended=true) s = strftime('%Y%m%d%H%M%S') if extended # some servers need exactly 3 decimal places for sec_fraction s = s + '.000' # use Time class to return TZ in correct format for OFX # ie. ("EDT" vs. "-07:00") tz = to_time.zone s = s + '[0:' + tz + ']' if tz end return s end |
#to_ofx_102_s_defunct ⇒ Object
100 101 102 |
# File 'lib/ofx/1.0.2/serializer.rb', line 100 def to_ofx_102_s_defunct strftime('%Y%m%d%H%M%S.') + (sec_fraction * 86400000000).to_i.to_s + '[' + offset.numerator.to_s + ':' + strftime('%Z') + ']' end |
#to_time ⇒ Object
96 97 98 |
# File 'lib/ofx/1.0.2/serializer.rb', line 96 def to_time Time.parse(self.to_s) end |