Class: DmozSax::TimeParser
- Inherits:
-
Object
- Object
- DmozSax::TimeParser
- Defined in:
- lib/dmoz_sax/time_parser.rb
Instance Method Summary collapse
Instance Method Details
#time_from(string) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/dmoz_sax/time_parser.rb', line 3 def time_from string arr = string.split(/[-\s:]/).map(&:to_i) Time.utc(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]) rescue Exception => e nil end |