Method: String#to_date_lex
- Defined in:
- lib/ferret/number_tools.rb
#to_date_lex ⇒ Object
Convert a string to a Date. This method will only work on strings that match the format %Y%m%d %H%M%S, otherwise the result will be unpredictable.
134 135 136 |
# File 'lib/ferret/number_tools.rb', line 134 def to_date_lex return Date.strptime(self + "-02-01", "%Y-%m-%d") end |