Re: mktime

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

 



Dan Brow wrote:
A little confused with mktime, I'm trying to get how many days are in a
year.

How about doing it differently. I'd tackle this problem like this:

<?php
$year = '2005';
$time = strtotime("1 January $year");
$isLeapYear = date('L', $time);

if($isLeapYear == '1') {
	$days = 366;
} else {
	$days = 365;
}
?>

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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