Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Date.jisx0301

Date.jisx0301(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 JIS X 0301 format:

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

For no-era year, legacy format, Heisei is assumed.

Example
Date.jisx0301('13.02.03') # => #<Date: 2001-02-03>

See:

  • Argument start.

  • Argument limit.

Related: Date._jisx0301 (returns a hash).

See also #jisx0301 ._jisx0301 .json_create .jd also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0