Method: Vcard.array_datetime_to_time

Defined in:
lib/vcard.rb

.array_datetime_to_time(dtarray) ⇒ Object

:nodoc:



97
98
99
100
101
102
103
# File 'lib/vcard.rb', line 97

def self.array_datetime_to_time(dtarray) #:nodoc:
# We get [year, month, day, hour, min, sec, usec, tz]
  tz = (dtarray.pop == "Z") ? :gm : :local
  Time.send(tz, *dtarray)
rescue ArgumentError => e
  raise ::Vcard::InvalidEncodingError, "#{tz} #{e} (#{dtarray.join(', ')})"
end