On 05/14/2005 07:05 PM, Matthew Keene wrote: > I have found what appears to be a bug in either the Date or the > ParseDate standard libraries > > The program below > > require 'date' > require 'parsedate' > > p Time.new > p Date._parse(Time.new.to_s) > p ParseDate.parsedate(Time.new.to_s) > > produces the following output: > > Sat May 14 23:28:42 AUS Eastern Standard Time 2005 > {:zone=>"AUS", :sec=>42, :hour=>23, :wday=>6, :mday=>14, :min=>28, > :mon=>5} > [nil, 5, 14, 23, 28, 42, "AUS", 6] > > The output from the ParseDate contains a year of nil (which I know isn't > right), and this seems to be because the _parse method of Date (which is > what ParseDate uses) doesn't return a year key in the hash. > > > Is there something I'm missing here ? The documentation for these > standard libraries doesn't have any description for either the parsedate > method of ParseDate or the _parse method of Date, so I can't fully tell > if this is working as designed, but it seems unlikely. > > What is the procedure for filing a bug for cases like this ? irb(main):001:0> require 'date' => true irb(main):002:0> require 'parsedate' => true irb(main):003:0> p Time.new Sat May 14 19:28:13 IST 2005 => nil irb(main):004:0> p Date._parse(Time.new.to_s) {:mon=>5, :zone=>"IST", :sec=>25, :year=>2005, :min=>28, :hour=>19, :wday=>6, :mday=>14} => nil irb(main):005:0> p ParseDate.parsedate(Time.new.to_s) [2005, 5, 14, 19, 28, 35, "IST", 6] => nil irb(main):006:0> [bsd@cto bsd]$ Hey, it is working fine over here, which you can verify from above. BTW, which version of Ruby are you using? I have tested it on ruby 1.8.2 (2005-04-11) [i386-linux] and irb 0.9(02/07/03). -- Dr Balwinder Singh Dheeman Registered Linux User: #229709 CLLO (Chief Linux Learning Officer) Machines: #168573, 170593, 259192 Anu's Linux@HOME Distros: Ubuntu, Fedora, Knoppix More: http://anu.homelinux.net/~bsd/ Visit: http://counter.li.org/