date() returning wrong day although the timestamp is correct!
- by Spiros
I have a bizzare problem with php date function.
code:
$numDays = 8;
$date = strtotime('2010-11-06');
for ($i=1; $i<=$numDays; $i++)
{
$thisDay = date("D, d M Y", $date);
print ($thisDay.'<br>');
$date+=86400; // add one day to timestamp
}
result on my server (local host, windows):
Sat, 06 Nov 2010
Sun, 07 Nov 2010
Mon, 08 Nov 2010
Tue, 09 Nov 2010
Wed, 10 Nov 2010
Thu, 11 Nov 2010
Fri, 12 Nov 2010
Sat, 13 Nov 2010
Result on my web server (linux)
Sat, 06 Nov 2010
*Sun, 07 Nov 2010
Sun, 07 Nov 2010*
Mon, 08 Nov 2010
Tue, 09 Nov 2010
Wed, 10 Nov 2010
Thu, 11 Nov 2010
Fri, 12 Nov 2010
Notice how Sun, 07 Nov 2010 appears twice on the remote server?? Why is this happening? can anyone explain this Behavior?