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 = '-4712-01-01', start = Date::ITALY, limit: 128) → date

Returns a new Date object with 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) # => #<Date: 2001-02-03>

See:

  • Argument start.

  • Argument limit.

Related: Date._xmlschema (returns a hash).

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