getting # of days in a month
Posted: Thu Aug 25, 2005 3:11 pm
how can I get the # of days in a month and what day the 1st of the month starts on?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$time = mktime(12,34,56,7,8,2009);
$daysInMonth = date('t', $time);
$firstIsA = date('l',mktime(6,0,0,date('j',$time),1,date('Y',$time));Code: Select all
$lastday = mktime(0, 0, 0, 3, 0, 2000);
echo strftime("The number of days in Febuary in 2000 is: %d", $lastday);Code: Select all
date("l", mktime(0, 0, 0, 7, 1, 2000));