note 102629 added to class.dateperiod

[email protected] Fri, 25 Feb 2011 00:19:58 -0800
Newsgroups php.notes
Message-ID <[email protected]>
If you want to include the end-date, add one day to it:

<?php
$startDate = new DateTime();
$endDate = new DateTime();

$startDateInt = new DateInterval( "P1Y" );
$endDateInt = new DateInterval( "P1D" );

$startDate->sub( $startDateInt );
$endDate->add( $endDateInt );

$periodInt = new DateInterval( "P1M" );
$period = new DatePeriod( $startDate, $periodInt, $endDate );

// At februari 2011:
// $period = (8,9,10,11,12,1,2)
?>
----
Server IP: 83.137.20.135
Probable Submitter: 83.98.252.88
----
Manual Page -- http://www.php.net/manual/en/class.dateperiod.php
Edit        -- https://master.php.net/note/edit/102629
Del: integrated  -- https://master.php.net/note/delete/102629/integrated
Del: useless     -- https://master.php.net/note/delete/102629/useless
Del: bad code    -- https://master.php.net/note/delete/102629/bad+code
Del: spam        -- https://master.php.net/note/delete/102629/spam
Del: non-english -- https://master.php.net/note/delete/102629/non-english
Del: in docs     -- https://master.php.net/note/delete/102629/in+docs
Del: other reasons-- https://master.php.net/note/delete/102629
Reject      -- https://master.php.net/note/reject/102629
Search      -- https://master.php.net/manage/user-notes.php