strtotime bug or code wrong??

Hello all,
Here is my problem, please bare with me, I will try to keep it simple…

When using the strtotime() function I have noticed that when using any month of any year it comes up empty after 12th day and begins working again at the 1st of the next month.

[code]<?php
$one_day = 60 * 60 * 24;

for($i=0; $i < 1200; $i++)
{
$new_day = $one_day * $i;
$new_date = time() + $new_day;
$fdate = date(“m-d-Y”, $new_date);

echo "<br>";
echo "Next day: " . $fdate . "<br>";
$strtt = strtotime($fdate);
echo "StrtoTime: " . $strtt;
echo "<br>";
if(empty($strtt))
{
	echo "Empty!";
}
else
{
	echo "Not Empty!";
}
echo "<br>";

}
?>[/code]

This is happening in 5.2.5, and 2 previous versions of 5. But does not happen in 4.4.4.

If someone else can help me test this or if I am just completely stupid and did something wrong, let me know.

Thanks.

When I saw you write ‘empty after the 12th day and begins working again at the first of the next month’ I added 1 and 1: it’s not stopping at the 12th day of the month, it’s stopping at the 12th month of the year :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service