tas nav tas... kļūda notiek pie mēnešu pārejas, izskatās ka kaut kāds bugs...
$r = 7*24*60*60;
$a = 1143925199;
$b = 1143320400;
print date( 'd-m-Y H:i:s', $b);
print date( 'd-m-Y H:i:s', $b+$r);
= 25-03-2006 23:00:00
= 02-04-2006 00:00:00
Tā kā mēs skaitam klāt tikai veselas dienas, laikam bija jāpaliek tādam pašam
UPD3:
Ha ha ha....
$s = strtotime('next sunday');
for ($i=0;$i<=100;$i++) {
$lts = $s-1;
$gts = strtotime('-1 week',$s);
$lt = date('d-m-Y H:i:s', $lts);
$gt = date('d-m-Y H:i:s', $gts);
echo $gt.'('.$gts.') - '.$lt.'('.$lts.') ['.$r.' / '.($lts-$gts).']<br />';
$s = strtotime('-1 week',$s);
}
09-04-2006 00:00:00(1144530000) - 15-04-2006 23:59:59(1145134799) [604800 / 604799]
02-04-2006 00:00:00(1143925200) - 08-04-2006 23:59:59(1144529999) [604800 / 604799]
26-03-2006 00:00:00(1143324000) - 01-04-2006 23:59:59(1143925199) [604800 / 601199]
19-03-2006 00:00:00(1142719200) - 25-03-2006 23:59:59(1143323999) [604800 / 604799]
12-03-2006 00:00:00(1142114400) - 18-03-2006 23:59:59(1142719199) [604800 / 604799]