Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Date._xmlschema

Date._xmlschema(string, limit: 128) → hash

Returns a hash of values parsed from string, which should be a valid XML date format:

Example
d = Date.new(2001, 2, 3)
s = d.xmlschema    # => "2001-02-03"
Date._xmlschema(s) # => {:year=>2001, :mon=>2, :mday=>3}

See argument limit.

Related: Date.xmlschema (returns a Date object).

See also .valid_ordinal? .xmlschema .valid_jd? #+ also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0