Project

General

Profile

Actions

Bug #15506

closed

ArgumentError on some ordinal dates

Added by v49564 (Victor Bruley) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
[ruby-core:90897]

Description

Seems the bug was introduced with r64028:
Adding the difference between two ordinal dates (source:lib/time.rb#L210 : day += diff) results in month days superior to 31 for dates at the beginning of a month, causing the out of range error.

require "time"
Time.strptime("91095", "%y%j")
 => 1991-04-05 00:00:00 -0400

Time.strptime("91093", "%y%j")
Traceback (most recent call last):
        4: from lib/ruby/2.6.0/time.rb:451:in `strptime'
        3: from lib/ruby/2.6.0/time.rb:211:in `make_time'
        2: from lib/ruby/2.6.0/time.rb:257:in `make_time'
        1: from lib/ruby/2.6.0/time.rb:257:in `local'
ArgumentError (argument out of range)

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #15776: Difference between Time.parse behaviour between 2.6.0 and 2.6.1+Rejectednobu (Nobuyoshi Nakada)Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66735.


Fix mday overflow

[ruby-core:90897] [Bug #15506]

Actions #2

Updated by nagachika (Tomoyuki Chikanaga) over 5 years ago

  • Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED

Updated by naruse (Yui NARUSE) over 5 years ago

  • Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r66825 merged revision(s) 66735.

Actions #4

Updated by mame (Yusuke Endoh) about 5 years ago

  • Related to Bug #15776: Difference between Time.parse behaviour between 2.6.0 and 2.6.1+ added
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0