date_default_timezone_set("Europe/Bucharest");
$begin = new DateTime( '2000-1-1' );
$end = new DateTime( '2001-1-1' );

$interval = DateInterval::createFromDateString('1 day');
$period = new DatePeriod($begin, $interval, $end);

foreach ( $period as $dt )
  echo $dt->format( "Y-m-dn" );

The above code will echo all dates from 2000-1-1 to 2001-1-1

If this has been useful you should give me a beer

Comment now!
















Trackbacks