Re: Function mktime() documentation question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> To get the number of days for a specific month, I use:
>
> // $current_month is the month under question
>
> $next_month = $current_month + 1;

I use this

$next_month = $current_month + 1;
$next_month_1    = mktime(0, 0, 0,     $next_month, 1, date("Y") );
$current_month_1= mktime(0, 0, 0, $current_month, 1, date("Y") );
$mdays = ($current_month_1 - $next_month_1)/(3600*24);

It's much more easier if you use DateTime and DateInterval class



-- 
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux