From: naruse@airemix.jp
To: ruby-core@ruby-lang.org
Subject: [ruby-core:91096] [Ruby trunk Bug#15506] ArgumentError on some ordinal dates
Date: Tue, 15 Jan 2019 08:54:15 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-76332.20190115085414.2ac82e3a7f5173ee@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15506.20190105172850@ruby-lang.org
Issue #15506 has been updated by naruse (Yui NARUSE).
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.
----------------------------------------
Bug #15506: ArgumentError on some ordinal dates
https://bugs.ruby-lang.org/issues/15506#change-76332
* Author: v49564 (Victor Bruley)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
* Backport: 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE
----------------------------------------
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)
~~~
--
https://bugs.ruby-lang.org/
prev parent reply other threads:[~2019-01-15 8:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-15506.20190105172850@ruby-lang.org>
2019-01-05 17:28 ` [ruby-core:90897] [Ruby trunk Bug#15506] ArgumentError on some ordinal dates victor
2019-01-15 8:54 ` naruse [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-76332.20190115085414.2ac82e3a7f5173ee@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).