Posted by Steve on 01/07/08 23:50
"Chuck Anderson" <websiteaddress@seemy.sig> wrote in message
news:XPydnf0HlbrEKh_anZ2dnUVZ_ruqnZ2d@comcast.com...
> ysoussov@gmail.com wrote:
>> Hey does anyone know of an easy script to use to figure out whether
>> the current date is a weekend or not, i currently have a script that
>> returns the current date and time. Also it would be great if it could
>> take into account holidays.
>>
>
> |gregoriantojd($month, $day, $year) % 7 = $day_of_the_week // Monday = 0|
forgot about modulus!
$dateInfo = getdate(date());
$isWeekend = $dateInfo['wday'] % 6 == 0;
that is faster than in_array. good catch.
Navigation:
[Reply to this message]
|