On Dec 27, 9:06=A0am, fw <fwmailingli... / gmail.com> wrote:
> On Thu, 2007-12-27 at 22:39 +0900, Junkone wrote:
> > i get the following error. wonder why
>
> > irb(main):068:0> @@config["date"]
> > =3D> "27/12/2007"
> > irb(main):069:0> Time.parse(@@config["date"])
> > ArgumentError: argument out of range
> > =A0 =A0 =A0 =A0 from e:/ruby/lib/ruby/1.8/time.rb:184:in `local'
> > =A0 =A0 =A0 =A0 from e:/ruby/lib/ruby/1.8/time.rb:184:in `make_time'
> > =A0 =A0 =A0 =A0 from e:/ruby/lib/ruby/1.8/time.rb:243:in `parse'
> > =A0 =A0 =A0 =A0 from (irb):69
> > =A0 =A0 =A0 =A0 from :0
> > irb(main):070:0>
>
> You have the month and day swapped - there's no 27th month in a year:
>
> $ irb
> irb(main):001:0> require 'time'
> =3D> true
> irb(main):002:0> Time.parse('27/12/2007')
> ArgumentError: argument out of range
> =A0 =A0 =A0 =A0 from /home/felix/ruby1.8.6/lib/ruby/1.8/time.rb:184:in `lo=
cal'
> =A0 =A0 =A0 =A0 from /home/felix/ruby1.8.6/lib/ruby/1.8/time.rb:184:in
> `make_time'
> =A0 =A0 =A0 =A0 from /home/felix/ruby1.8.6/lib/ruby/1.8/time.rb:243:in `pa=
rse'
> =A0 =A0 =A0 =A0 from (irb):2
> irb(main):003:0> Time.parse('12/27/2007')
> =3D> Thu Dec 27 00:00:00 -0800 2007
> irb(main):004:0>
>
> HTH,
>
> Felix

i have a canadian layout and my regional settings on my computer is
set to dd/mm/yyyy. strange that ruby cannot get this one right. all my
office apps and my oracle and mysql databases now recognise this
format on my computer.