From: Sam Roberts Date: 2004-04-20T04:06:03+09:00 Subject: Re: How do you know it quacks like a duck? Wrote Dan Doel , on Mon, Apr 19, 2004 at 09:55:43AM +0900: > Just use it as you would a Time object. That doesn't work for me, if you look at my example, I need to know if it's a Date or a Time, and I need to treat them differently. But, I would like to support any object which is "date-like" or "time-like". DateTime, in ruby 1.8, for example, is actually time-like (it has hours, mins, secs). I can see if it's string-like or array-like by checking for #to_str or #to_ary, but is there a general case? Maybe I'll just write a function that checks for the year/mon/day methods and hour/min/sec methods, to distinguish. Cheers, Sam -- Sam Roberts