From: Damphyr Date: 2005-09-28T17:39:04+09:00 Subject: [REXML] Wierd behaviour with Date Robert Klemme wrote: > Damphyr wrote: > >> Tell me where does everything get mixed-up >> >> site.rb:167:in `generate': undefined method `strptime' for >> "+2004/200":String (NoMethodError) >> >> The offending line is >> >> date_i=Date.strptime(date_txt,"%d.%m.%Y") >> >> How can Date be "+2004/200" ? > Date = "+2004/200" > > As easy as that... :-) > > This works: >>> require 'date' > > => true > >>> date_txt = "10.10.2004" > > => "10.10.2004" > >>> Date.strptime(date_txt,"%d.%m.%Y") > > => # > > What did you do? > That's my question. And I think I found it: If I do class Article include REXML ... ... end I get the error with strptime. If I use REXML::Document and don't include, then everything is fine. So REXML does something to Date. I run ruby 1.8.2 (2004-12-25) [i386-mswin32] Cheers, V.- ____________________________________________________________________ http://www.freemail.gr - ������ �������� ������������ ������������. http://www.freemail.gr - free email service for the Greek-speaking.