PHP应该没有这种函数,最接近的应该是下面的函数了: mcal_day_of_year (PHP 3>= 3.0.13, PHP 4 >= 4.0b4)mcal_day_of_year -- Returns the day of the year of the given date Descriptionint mcal_day_of_year(int year, int month, int day) mcal_day_of_year() returns the day of the year of the given date.
mcal_day_of_year
(PHP 3>= 3.0.13, PHP 4 >= 4.0b4)mcal_day_of_year -- Returns the day of the year of the given date
Descriptionint mcal_day_of_year(int year, int month, int day)
mcal_day_of_year() returns the day of the year of the given date.
/*------------------------------------------------------------------------
程序名称 : dateAdd function
版权所有 : y10k
E-mail : [email protected]
OICQ : 6795798
主页地址: http://www.zphp.com/
------------------------------------------------------------------------*/
// date format yyyy-mm-dd
function dateMinus($date1, $date2) {
preg_match('/(\d+)-(\d+)-(\d+)/', $date1, $tmp1);
preg_match('/(\d+)-(\d+)-(\d+)/', $date2, $tmp2);
$timestamp1 = mktime(0, 0, 0, $tmp1[2], $tmp1[3], $tmp1[1]);
$timestamp2 = mktime(0, 0, 0, $tmp2[2], $tmp2[3], $tmp2[1]);
return ($timestamp2-$timestamp1) / (60*60*24);
}
?>