From: "Mark J. Reed" Date: 2003-08-20T23:28:51+09:00 Subject: Re: ParseDate and Time On Wed, Aug 20, 2003 at 02:20:09PM +0000, Jason Williams wrote: > Why don't ParseDate and Time play nicely together? o/~ ParseDate, Date, Rosemary and Time . . . o/~ Ahem. > I'd have thought ParseDate could output a Time object, or at least > Time could accept the array that ParseDate emits. It can. irb(main):009:0> puts Time.gm(*parsedate("1993-01-01T00:00:00Z")) Fri Jan 01 00:00:00 UTC 1993 => nil Or you can assume local time, instead: irb(main):010:0> puts Time.local(*parsedate("Wed, Aug 20, 2003 at 02:20:09PM")) Wed Aug 20 14:20:09 EDT 2003 => nil The Ruby class design philosophy is not to use multiple constructors, but rather to have class methods with names that tell you what they're doing. Always look at the class methods if you need some non-default way to make an instance - there may be one there. (Oh, Time.local has an alias called Time.mktime, but I prefer to explicitly note the local timezone assumption). -Mark