hendra kusuma wrote:> I found error when I parse a string to date using Time.parse
> I use 3 textctrl to get date, month and year
> then I combine them into a string with format yyyy-mm-dd (because I am
> going to save the date to mysql)
>
> then I parse it to date to check if the date valid with
> begin
> bday = Time.parse(''yyyy-mm-dd'')
> rescue
> puts "error"
> end
>
> somehow, it works ok if the year > 1971
> but it give me error message starting from 1970 and less
>
> error message show something about time.rb:184:in
''local'': argument
> out of range
Ruby''s Time class only supports dates after 1970 (the start of the
"epoch"), at least, it''s only guaranteed to support dates
after then
portably. Use the standard ''datetime'' class to support a wider
range of
dates.
I believe this is changed in the current preview ruby 1.9.2
alex