|
Posted by Chuck Anderson on 11/27/06 00:20
laredotornado@zipmail.com wrote:
> Hi,
>
> I'm using PHP 4.4.4 and I was wondering if anyone knows of a function
> or quick way, given a scalar representation of month (as a number
> between 1 and 12), day, and year (as a four digit number, e.g. 2007),
> how would I tell if that day is a Saturday?
>
> Thanks, - Dave
>
>
Use mktime() with your month day and year as inputs to create a timestamp.
e.g., $tstamp = mktime(0, 0, 0, $month, $day, $year);
.... and then use:
date('l', $tstamp); to get the textual representation of the day of the
week
(or use 'N' to get 1 - 7, 6 being Saturday)
--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*****************************
Navigation:
[Reply to this message]
|