Method: ActiveShipping::UPS#parse_ups_datetime
- Defined in:
- lib/active_shipping/carriers/ups.rb
#parse_ups_datetime(options = {}) ⇒ Object (protected)
1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 |
# File 'lib/active_shipping/carriers/ups.rb', line 1091 def parse_ups_datetime( = {}) time, date = [:time].try(:text), [:date].text if time.nil? hour, minute, second = 0 else hour, minute, second = time.scan(/\d{2}/) end year, month, day = date[0..3], date[4..5], date[6..7] Time.utc(year, month, day, hour, minute, second) end |