method
to_datetime
v3.0.0 -
Show latest stable
- Class:
String
to_datetime()public
No documentation available.
# File activesupport/lib/active_support/core_ext/string/conversions.rb, line 47
def to_datetime
return nil if self.blank?
d = ::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec, :zone, :sec_fraction).map { |arg| arg || 0 }
d[5] += d.pop
::DateTime.civil(*d)
end