On Wed, 5 Feb 2003, Rick Measham wrote: > POD>> The behavior of this module when given parameters outside proper > POD>> boundaries (like a minute parameter of 72) is not defined, though > POD>> future versions may be die. > > I'd prefer the behavior of: > my $dt = DateTime->new( hour => 7, minute => 75); > > to be the equivalent of: > my $dt = DateTime->new( hour => 8, minute => 15); > > That is, > minute = minute + int(second/60) > second = second mod 60 > > hour = hour + int(minute/60) > minute = minute mod 60 > > day = day + int(hour / 24) > hour = hour mod 60
Actually, this _is_ what it does now, but it's not documented, so that shouldn't be relied upon. I'm not entirely sure that simply accepting _any_ number makes for a good API, however. I suspect that in many cases, numbers outside the expected boundaries may indicate an error on the caller's part. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/