class method
Date._parse
(::String str, ?::boolish complete) -> ::Hash[::Symbol, ::Integer]
Date._parse(string, comp = true, limit: 128) → hash
ext/date/date_core.c
View on GitHub ↗
static VALUE
date_s__parse(int argc, VALUE *argv, VALUE klass)
{
return date_s__parse_internal(argc, argv, klass);
}
Note: This method recognizes many forms in string, but it is not a validator. For formats, see “Specialized Format Strings” in Formats for Dates and Times
If string does not specify a valid date, the result is unpredictable; consider using Date._strptime instead.
Returns a hash of values parsed from string:
Example
Date._parse('2001-02-03') # => {:year=>2001, :mon=>2, :mday=>3}
If comp is true and the given year is in the range (0..99), the current century is supplied; otherwise, the year is taken as given:
Example
Date._parse('01-02-03', true) # => {:year=>2001, :mon=>2, :mday=>3} Date._parse('01-02-03', false) # => {:year=>1, :mon=>2, :mday=>3}
See argument limit.
Related: Date.parse(returns a Date object).