ArgumentError: invalid date
from (irb):9:in `strptime'
from (irb):9
from /usr/bin/irb:11:in `<main>'
I does not understand why '1582-10-12' is not considered a valid date.
I'm testing it with Ruby 2.1.5p273, that comes with Debian Jessie.
Regards,
Daniel
Date.strptime does not support dates that are pre-unix time (January 1st 1970)
>
> —
> Sent from Mailbox
>
>
> On Mon, Jun 15, 2015 at 3:00 PM, Daniel Hernandez <daniel@degu.cl> wrote:
>
> Hi,
>
> I guess this is a bug:
>
> $ irb
> > require 'date'
> => true
> > Date.strptime('1582-11-12', '%Y-%m-%d')
> => #<Date: 1582-11-12 ((2299189j,0s,0n),+0s,2299161j)>
> > Date.strptime('1582-10-12', '%Y-%m-%d')
> ArgumentError: invalid date
> from (irb):9:in `strptime'
> from (irb):9
> from /usr/bin/irb:11:in `<main>'
>
> I does not understand why '1582-10-12' is not considered a valid date.
> I'm testing it with Ruby 2.1.5p273, that comes with Debian Jessie.
>
> Regards,
> Daniel
>
>
>
>
>