PDA

View Full Version : Working out days in a month


kjc
12-07-2002, 12:18 PM
Hello

Does anyone know how to use php to calculate how many days are in a given future month?

Thanks

bcarl314
12-09-2002, 01:39 PM
I checked the documentation and strangly enough, I found this:

cal_days_in_month ( int calendar, int month, int year)

Have fun!

kjc
12-13-2002, 07:22 PM
Cheers!

kjc
12-17-2002, 03:04 PM
Further to the date question - does anyone know how to do get the day of the week for agiven date in the future?

I am designing a calendar using PHP/MySQL and want to know how to get the day of the week for a given day in the future.

Any ideas?

firepages
12-17-2002, 03:57 PM
check out the date function it can tell you all sorts of interesting things .. http://www.php.net/date
like


<?
//my last birthday under the current limitations of a UNIX timestamp on win32 !
$day=date ("l", mktime(0,0,0,8,15,2037));
echo $day;

//no of days in that month//
$nums=date ("t", mktime(0,0,0,8,15,2037));
echo $nums;

//is it a leap year ?//
$leap=date ("L", mktime(0,0,0,8,15,2037));
($leap==1)? print('true'): print('false');
?>

kjc
12-19-2002, 03:00 PM
Cheers guys :thumbsup: