Hi,
I wanted to discuss and report this issue so that this could be reported as a bug if it is the case.
Today is march 19, 2003 and am running the following code:
$_days = 21;
echo "<br>Now ->".date ("Y-m-d",strtotime("Now"));
echo "<br>Last Sunday ->".date ("Y-m-d",strtotime("Last Sunday"));
echo "<br>Now + $_days days ->".date ("Y-m-d",strtotime("Now + $_days days"));
echo "<br>Last Sunday + $_days days ->".date ("Y-m-d",strtotime("Last Sunday + $_days days"));
$secs_in_day = 60*60*24;
echo "<br>Last Sunday + $_days days (fixed) -> ".date ("Y-m-d",strtotime("Last Sunday")+$secs_in_day*$_days);
This is the output:
start output:
<br>Now ->2003-03-19
<br>Last Sunday ->2003-03-16
<br>Now + 21 days ->2003-04-09
<br>Last Sunday + 21 days ->2003-04-05
<br>Last Sunday + 21 days (fixed) -> 2003-04-06
end output.
Note that the last to lines of the output should be the same.
I have this problem ONLY with the first week of April (so far). That is, the last sunday of the first week of april 2003.
Could anyone help me check if this is a common behavior on different system configurations? I am using PHP version 4.2.2 on a Linux Red Hat 7.x (dont have the exact version now) and Apache 1.3.22
Thanks in advance,
abx_