Skip to content
class method

Date.iso8601

(::String str, ?::Integer start) -> ::Date
Date.iso8601(string = '-4712-01-01', start = Date::ITALY, limit: 128) → date

Returns a new Date object with values parsed from string, which should contain an ISO 8601 formatted date:

Example
d = Date.new(2001, 2, 3)
s = d.iso8601   # => "2001-02-03"
Date.iso8601(s) # => #<Date: 2001-02-03>

See:

Related: Date._iso8601 (returns a hash).

See also #iso8601 ._iso8601 .jd .httpdate also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0