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
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
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
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