Method: Date._parse

Defined in:
date_core.c

._parse(string[, comp = true]) ⇒ Hash

Parses the given representation of date and time, and returns a hash of parsed elements. This method does not function as a validator.

If the optional second argument is true and the detected year is in the range “00” to “99”, considers the year a 2-digit form and makes it full.

Date._parse('2001-02-03')	#=> {:year=>2001, :mon=>2, :mday=>3}

Returns:

  • (Hash)


4308
4309
4310
4311
4312
# File 'date_core.c', line 4308

static VALUE
date_s__parse(int argc, VALUE *argv, VALUE klass)
{
    return date_s__parse_internal(argc, argv, klass);
}