This message was edited by mac_doggie at 2006-1-4 3:14:50
// mktime parameters:
// hours, minutes, secods (don't need them so make them 0
// then month, day, year
// date("w") returns the day of the week 0 - 6 (0 beng sunday)
$dayofweek = date("w", mktime(0,0,0,12,1,2006));
also see: http://nl2.php.net/manual/en/function.date.php
: Use the strtotime and date functions. I'm not sure if that's the most efficient way, but it would work.
: strtotime let's to turn a string into a time represented as number of seconds since a fixed point. date accepts a number of seconds since the fixed point, and turns it into a string formatted however you want, according to the formatting string you input. So:
: $seconds = strtotime('1 December, 2006');
: $day = date('l', $seconds);
: That will get you the day (Sunday - Saturday) that falls on the date 12/1/2006.
: : I'm creating an online calendar for my faculty at my high school to use, but in order to properly display a given month, I need to know on what day of the week the first of the month falls. How do I query what day of the week a given date falls on? Thanks.
: : James