lib/fix/protocol/type_conversions.rb
#
# Parses a FIX-formatted timestamp into a Time instance, milliseconds are discarded
#
# @param str [String] A FIX-formatted timestamp
# @return [Time] An UTC date and time
#
Parses a FIX-formatted timestamp into a Time instance, milliseconds are discarded
Parses a FIX - formatted timestamp into a Time instance milliseconds are discarded
def parse_timestamp(str)
        if m = str.match(/\A([0-9]{4})([0-9]{2})([0-9]{2})-([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]{3})?\Z/)
          elts = m.to_a.map(&:to_i)
          Time.new(elts[1], elts[2], elts[3], elts[4], elts[5], elts[6], 0)
        end
      end
def parse_timestamp ( str ) if m = str . match ( / \A ([0-9]{4})([0-9]{2})([0-9]{2})-([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]{3})? \Z / ) elts = m . to_a . map ( & :to_i ) Time . new ( elts [ 1 ] , elts [ 2 ] , elts [ 3 ] , elts [ 4 ] , elts [ 5 ] , elts [ 6 ] , 0 ) end end
Parses a FIX-formatted timestamp into a Time instance, milliseconds are discarded
Parses a FIX - formatted timestamp into a Time instance milliseconds are discarded
An UTC date and time
An UTC date and time
Time
str
A FIX-formatted timestamp
A FIX - formatted timestamp