You are here: Re: Script to figure out if it's a weekend « PHP Programming Language « IT news, forums, messages
Re: Script to figure out if it's a weekend

Posted by Steve on 01/08/08 00:06

"Richard" <root@localhost> wrote in message
news:4782bcb2$0$42812$dbd43001@news.euronet.nl...
>
> "Steve" <no.one@example.com> wrote in message
> news:wKygj.591$bC4.225@newsfe05.lga...
>>
>> "Paul Lautman" <paul.lautman@btinternet.com> wrote in message
>> news:5ufo34F1hgmsqU1@mid.individual.net...
>>> 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.
>>>
>>> if (substr(date('D'),0,1) == 'S')
>>
>> L.U.D.I.C.R.O.U.S !!!
>>
>> $dateInfo = getdate(date());
>> $isWeekend = in_array($dateInfo['wday], array(0, 6));
>>
>> using substr is rediculous. 'domingo' is sunday and is ONE reason your
>> suggestion blows.
>
>
> if( date('N') == 6 || date('N') == 7)
>
> Wouldnt that do it?

more than one way to skin a cat. :)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация