class method
Date._rfc3339
(::String str) -> ::Hash[::Symbol, ::Integer | ::String]
Date._rfc3339(string, limit: 128) → hash
ext/date/date_core.c
View on GitHub ↗
static VALUE
date_s__rfc3339(int argc, VALUE *argv, VALUE klass)
{
VALUE str, opt;
rb_scan_args(argc, argv, "1:", &str, &opt);
if (!NIL_P(str)) str = check_limit(str, opt);
return date__rfc3339(str);
}
Returns a hash of values parsed from string, which should be a valid RFC 3339 format:
Example
d = Date.new(2001, 2, 3) s = d.rfc3339 # => "2001-02-03T00:00:00+00:00" Date._rfc3339(s) # => {:year=>2001, :mon=>2, :mday=>3, :hour=>0, :min=>0, :sec=>0, :zone=>"+00:00", :offset=>0}
See argument limit.
Related: Date.rfc3339 (returns a Date object).