Search code examples
pythonrubydatetimepython-dateutil

Is there a Ruby equivalent of Python's dateutil parser that can parse datetimes from multiple formats?


The dateutil library from Python is super useful for parsing strings of various common formats into datetime objects. Is there something similar for Ruby?


Solution

  • Date#parse and Date#strptime are in the ruby standard library. You need to require 'date' first.

    I have also used the chronic gem when those were insufficient.