Reputation: 43
I have a strange problem:
I get some data from the mysql database which I convert with strotime to a timestamp.
then I compare these timestamps with a for loop:
for ($i=$start;$i<=$end;$i=$i+86400){
$ptag=date("w",$i);
if ($i<=$checkdateend){
if ($wochendays[$ptag]==1){
if (!in_array($i,$solvedays)){
$solvedays[]=$i;
}
}
}
}
with a given day (also a timestamp)
where $wochendays=(0,0,1,0,1,0,0)
this works fine, but when I cross the summer/wintertime change I get a problem.
in the solvedays array there should be these values:
27.10.2012
28.10.2012
29.10.2012
but I get
27.10.2012
28.10.2012
28.10.2012
instead.
I guess the reason is the summertime change to wintertime, but I don't have any clue how to solve this problem. any hints?
Upvotes: 3
Views: 1177