downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

DatePeriod::__construct> <DateInterval::format
Last updated: Fri, 14 Aug 2009

view this page in

La classe DatePeriod

Introduction

Représentation d'une période de dates.

Synopsis de la classe

DatePeriod
DatePeriod implements Traversable {
/* Constantes */
const integer DatePeriod::EXCLUDE_START_DATE = 1 ;
/* Méthodes */
__construct ( DateTime $start , DateInterval $interval , int $recurrences [, int $options ] )
}

Constantes pré-définies

Types de noeuds DatePeriod

DatePeriod::EXCLUDE_START_DATE

Exclut la date de début, utilisé par DatePeriod::__construct().

Sommaire



add a note add a note User Contributed Notes
DatePeriod
jkaatz at gmx dot de
10-Jul-2009 08:55
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

DatePeriod::__construct> <DateInterval::format
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites