|
Posted by Janwillem Borleffs on 06/30/06 10:12
Stuart Colman wrote:
> Janwillem,
>
> Thanks for that, almost there. Your code outputs the following:
>
> 2006 Jun Thu (01)
> 2006 Jun Mon (12)
> 2006 Jun Thu (15)
> 2006 Jun Mon (26)
> 2006 Jun Thu (29)
>
> There are a few dates missing from the list, such as Mon 5th, Thu
> 8th, Mon 19th and Thu 22.
>
> Any ideas how to get these values too?
>
When I run the code on a Windows and a Linux box, I get the expected list:
2006 Jun Thu (01)
2006 Jun Mon (05)
2006 Jun Thu (08)
2006 Jun Mon (12)
2006 Jun Thu (15)
2006 Jun Mon (19)
2006 Jun Thu (22)
2006 Jun Mon (26)
2006 Jun Thu (29)
On a FreeBSD box, however, I get the shortened list. The problem appears to
be in this line:
$ts = strtotime('next monday', $ts);
On Windows and Linux, you will actually get the next monday, while on
FreeBSD (and perhaps also on other OS's) it will just skip it.
Removing "next" should fix it:
$ts = strtotime('monday', $ts);
JW
Navigation:
[Reply to this message]
|