On Thu, 5 Aug 2004, Ofer Nave wrote:

> run in epoch mode, and not even pay attention to hour.  Just like it
> wouldn't pay attention to billybob if I passed it ( epoch => time(), billbob
> => 'thornton' ).

Uh, have you tried that?  It'll throw an exception.  I'm a big believer in
dying on bad input, since if the user passes a billybob parameter they
probably expect that to have some effect.

> > If you start assuming a single argument is a particular parameter,
> > which do you go with in other cases. If you change one
> > method, you have
> > to be consistent.
> >     $dt = DateTime->new( 34 );
> > Is that 00:00:34 or 00:34:00 or 0034-00-00?
>
> Well, since year is the only required argument, you'd probably assume it was
> year, and therefore the date would be 0034-00-00 00:00:00.0!  :)  But that's
> probably a habit to encourage/allow.

Nor is it even particularly useful, I'd think.

> Yes, I know, but the idea is to make it convenient to do the most common
> things (which is why ymd() and hms() are, in fact, available), and it seems
> to be like a combined ymd_hms would qualify that list.  Especially being the
> ISO8601 standard time format, and that you often want to print both date and
> time.

Thus the datetime/iso8601 methods (they're the same method internally).


-dave
/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to