note 92130 added to class.dateperiod

From: Date: Fri, 10 Jul 2009 08:55:29 +0000
Subject: note 92130 added to class.dateperiod
Groups: php.notes 
Request: Send a blank email to php-notes+get-158132@lists.php.net to get a copy of this message
Nice example from PHP Spring Conference (thanks to Johannes Schlüter and David Zülke) <?php $begin = new DateTime( '2007-12-31' ); $end = new DateTime( '2009-12-31 23:59:59' ); $interval = DateInterval::createFromDateString('last thursday of next month'); $period = new DatePeriod($begin, $interval, $end, DatePeriod::EXCLUDE_START_DATE); foreach ( $period as $dt ) echo $dt->format( "l Y-m-d H:i:s\n" ); ?> DateInterval specs could be found at http://en.wikipedia.org/wiki/ISO_8601#Time_intervals ---- Server IP: 69.147.83.197 Probable Submitter: 85.183.23.81 ---- Manual Page -- http://www.php.net/manual/en/class.dateperiod.php Edit -- https://master.php.net/note/edit/92130 Del: integrated -- https://master.php.net/note/delete/92130/integrated Del: useless -- https://master.php.net/note/delete/92130/useless Del: bad code -- https://master.php.net/note/delete/92130/bad+code Del: spam -- https://master.php.net/note/delete/92130/spam Del: non-english -- https://master.php.net/note/delete/92130/non-english Del: in docs -- https://master.php.net/note/delete/92130/in+docs Del: other reasons-- https://master.php.net/note/delete/92130 Reject -- https://master.php.net/note/reject/92130 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#158132) next »