[CODE]<?php
$today = date(“j-n-Y”);
$datetime_temp = strtotime($today);
$datetime_end = strtotime(“30-11-2009”);
while($datetime_temp <= $datetime_end) {
echo date(“j-M-Y”, $datetime_temp).”<br />”;
$datetime_temp += 86400; //there are 86,400 seconds in a day
}
?>
The script above should print out all the dates between today and 30-11-2009. Except that the last day that gets printed out is
29-Nov-2009. But if I change $datetime_end to: $datetime_end = strtotime(“30-9-2009”);
The last day to be printed out is 30-Sep-2009.
I don’t understand what the problem is, if I increase the date it omits one day, but if the date is lower it prints out the final day. What is the problem?