Module: TimestampParser

Included in:
Elibri::ONIX::Release_3_0::ExcerptInfo, Elibri::ONIX::Release_3_0::FileInfo
Defined in:
lib/elibri_onix/timestamp_parser.rb

Instance Method Summary collapse

Instance Method Details

#parse_timestamp(value) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/elibri_onix/timestamp_parser.rb', line 3

def parse_timestamp(value)
  year = value[0...4].to_i
  month = value[4...6].to_i
  day = value[6...8].to_i
  h = value[9...11].to_i
  m = value[11...13].to_i
  Time.new(year, month, day, h, m)
end