Project

General

Profile

Actions

Backport #3327

closed

Date.parse returns incorrect result when text date delimited with "_"

Added by rwagenet (Ralph Wagenet) almost 14 years ago. Updated over 12 years ago.

Status:
Rejected
Assignee:
-
[ruby-core:30338]

Description

=begin
Date.parse('01_01_2010')
=> #<Date: 2010-05-01 (4910635/2,0,2299161)>

ruby 1.9.2dev (2010-05-13 revision 27783) [x86_64-darwin10.3.0]
=end

Actions #1

Updated by matz (Yukihiro Matsumoto) almost 14 years ago

=begin
Hi,

In message "Re: [ruby-core:30338] [Backport #3327] Date.parse returns incorrect result when text date delimited with "_""
on Fri, 21 May 2010 06:12:23 +0900, Ralph Wagenet writes:

|Date.parse('01_01_2010')
|=> #<Date: 2010-05-01 (4910635/2,0,2299161)>
|
|ruby 1.9.2dev (2010-05-13 revision 27783) [x86_64-darwin10.3.0]

First, Date.parse does not support the date strings delimited by "_".

Second, Date.parse ignores trailing garbage.

Third, Date.parse parses single number as a day of the current month,
so that "01_01_2010" is considered as "01" which means the first day
of the current month (May 2010).

						matz.

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 14 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0