round() - DateTime method proposal

2003-03-05 Thread fglock
round() - new DateTime method proposal The round() method would do to a DateTime what "int" does to scalars: remove some fractional information. Example: $date->round( 'day' ); would be the same as: $date->set( day => 1, hour => 0, minute => 0, second => 0 ); The rationale for this is

Re: round() - DateTime method proposal

2003-03-05 Thread fglock
fglock wrote: > $date->round( 'day' ); > would be the same as: > $date->set( day => 1, hour => 0, minute => 0, second => 0 ); bugfix: $date->round( 'day' ); would be the same as: $date->set( hour => 0, minute => 0, second => 0 ); - Flavio S. Glock

Re: round() - DateTime method proposal

2003-03-06 Thread Dave Rolsky
On Wed, 5 Mar 2003, Tim Bunce wrote: > Or trunc() / truncate to match the Oracle SQL function that does > the same thing. It's definitely not 'rounding', though there is > some use for rounding and Oracle has a round() function for dates. I like truncate. I think its a winner ;) What does Oracl

Re: round() - DateTime method proposal

2003-03-07 Thread Tim Bunce
On Thu, Mar 06, 2003 at 12:05:30PM -0600, Dave Rolsky wrote: > On Wed, 5 Mar 2003, Tim Bunce wrote: > > > Or trunc() / truncate to match the Oracle SQL function that does > > the same thing. It's definitely not 'rounding', though there is > > some use for rounding and Oracle has a round() function