From: victor@scangeo.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:90897] [Ruby trunk Bug#15506] ArgumentError on some ordinal dates
Date: Sat, 05 Jan 2019 17:28:52 +0000 (UTC) [thread overview]
Message-ID: <redmine.issue-15506.20190105172850.d7da2bb1ad4e1316@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-15506.20190105172850@ruby-lang.org
Issue #15506 has been reported by v49564 (Victor Bruley).
----------------------------------------
Bug #15506: ArgumentError on some ordinal dates
https://bugs.ruby-lang.org/issues/15506
* Author: v49564 (Victor Bruley)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
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/
next parent reply other threads:[~2019-01-05 17:29 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 ` victor [this message]
2019-01-15 8:54 ` [ruby-core:91096] [Ruby trunk Bug#15506] ArgumentError on some ordinal dates naruse
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.issue-15506.20190105172850.d7da2bb1ad4e1316@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).