Method: Time.iso8601
- Defined in:
- lib/project/ext/time.rb
.iso8601(iso8601_string) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/project/ext/time.rb', line 2 def self.iso8601(iso8601_string) timestring = iso8601_string.toString timestring = timestring.replaceAll("Z", "+00:00") timestring = timestring.substring(0, 22) + timestring.substring(23) date = Java::Text::SimpleDateFormat.new("yyyy-MM-dd'T'HH:mm:ss+SSS").parse(timestring) Time.new(date.getTime()) end |