From: Matthew Keene Date: 2005-05-15T12:00:30+09:00 Subject: Re: Possible bug in Date/ParseDate Yukihiro Matsumoto wrote: > > Date._parse does not recognize long timezone including spaces, such as > "AUS Eastern Standard Time". It is a known limitation. I'm not sure > there is any standard for the timezone format. > > matz. I thought that this might be the problem, but I guess the question is why does Time.now produce the date in this format if other standard libraries can't handle it ? Either Time.now should say Sat May 14 23:28:42 AET 2005 or the standard libraries should be able to handle it. In other words, if you say: puts Time.now #...1 t = Time.now.to_s time_array = ParseDate.parsedate(t) puts Time.local(*time_array) #...2 then the puts at 1 and 2 should say the same thing. What shouldn't happen (IMHO) is this... Sun May 15 12:48:28 AUS Eastern Standard Time 2005 bug.rb:11:in `local': no implicit conversion from nil to integer (TypeError) from bug.rb:11 ..which is what actually happens Just to prove it (mainly to myself - I've only been using Ruby for a week or two, and I think that you might understand it a little better than I do :)), I tried the following: time_array = ParseDate.parsedate("Sun May 15 12:48:28 AET 2005") puts Time.local(*time_array) which prints Sun May 15 12:48:28 AUS Eastern Standard Time 2005 So it's this inconsistency that I think is the bug, not the inability of ParseDate to handle timezones with spaces.