Forum: Ruby on Rails WebServices and DateTime - 3 elements of civil date are nece

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
783fed8af50259766b40d2f550ec5974?d=identicon&s=25 zven (Guest)
on 2006-05-18 21:43
(Received via mailing list)
I simply trying to receive an array of objects, retrieved by
ActiveRecord from table with datetime column and I have:

test_list(SoapControllerApiTest):
ArgumentError: 3 elements of civil date are necessary
    /usr/lib/ruby/1.8/date.rb:1214:in `new_with_hash'
    /usr/lib/ruby/1.8/date.rb:1258:in `parse'
....

It's a bug or I am wrong somewhere?
4d36263101dd43d8c3d3692fccbc7147?d=identicon&s=25 Chris Goodwin (Guest)
on 2006-05-18 22:24
Are you using Windows?  I ran into the same problem.  There is a problem
with Ruby and the Windows DateTime format.  I still haven't found a
solution to this.  Supposedly ruby 1.9 fixes this, but after replacing
the 1.8 date files with the 1.9 ones it still doesn't work for me.

zven wrote:
> I simply trying to receive an array of objects, retrieved by
> ActiveRecord from table with datetime column and I have:
>
> test_list(SoapControllerApiTest):
> ArgumentError: 3 elements of civil date are necessary
>     /usr/lib/ruby/1.8/date.rb:1214:in `new_with_hash'
>     /usr/lib/ruby/1.8/date.rb:1258:in `parse'
> ....
>
> It's a bug or I am wrong somewhere?
783fed8af50259766b40d2f550ec5974?d=identicon&s=25 zven (Guest)
on 2006-05-18 22:39
(Received via mailing list)
On Thu, 2006-05-18 at 22:24 +0200, Chris Goodwin wrote:
> Are you using Windows?  I ran into the same problem.  There is a problem
> with Ruby and the Windows DateTime format.  I still haven't found a
> solution to this.  Supposedly ruby 1.9 fixes this, but after replacing
> the 1.8 date files with the 1.9 ones it still doesn't work for me.
>

Nope, I am using Debian.
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2006-05-19 01:57
(Received via mailing list)
Hi, what's the relevant code that generates the below error?
If you can post the relevant method, it would help the group
better help you.

Thanks,

-Conrad
3eda6fcd3204ef285fa52176c28c4d3e?d=identicon&s=25 Jeff K (Guest)
on 2006-09-27 21:47
Using Ruby 1.8.4, Windows, and MySQL I ran into the same problem using
the example in "Agile Web Development with Rails". (The same code worked
fine on my coworker's Mac.)

If you want a really, really lame workaround so that you can continue in
your development, you can add this to the
self.parse(str='-4712-01-01T00:00:00Z', comp=false, sg=ITALY) function
in date.rb:

    str.gsub!(" Eastern", "E")
    str.gsub!(" Standard", "S")
    str.gsub!(" Daylight", "D")
    str.gsub!(" Time", "T")

... before the "elem = _parse(str, comp)". (Make sure you add your time
zone in there, too.)
This topic is locked and can not be replied to.