$aa=strtotime(2006.3.23)-strtotime(2006.4.13);
$ss=date("d",$aa);
echo $ss;试试?
我是才想出来的
对不起
不知道对吗?

解决方案 »

  1.   

    <?
    $str1=strtotime("2005-02-28");
    $str2=strtotime("2005-03-28");
     print_r($str1.'<br>'.$str2);
     print_r('<br>'.($str2-$str1)/(3600*24).'<br>');
     for($i=1;$i<($str2-$str1)/(3600*24);$i++){
    echo date("Y-m-d",$str1+3600*24*$i).'<br>';
     }
     /*
     1109520000
    1111939200
    28
    2005-03-01
    2005-03-02
    2005-03-03
    2005-03-04
    2005-03-05
    2005-03-06
    2005-03-07
    2005-03-08
    2005-03-09
    2005-03-10
    2005-03-11
    2005-03-12
    2005-03-13
    2005-03-14
    2005-03-15
    2005-03-16
    2005-03-17
    2005-03-18
    2005-03-19
    2005-03-20
    2005-03-21
    2005-03-22
    2005-03-23
    2005-03-24
    2005-03-25
    2005-03-26
    2005-03-27
    */
    ?>
      

  2.   

    取得两个日期的差:
    $date1="2006-3-23";
    $date2="2006-4-13";
    $d1=strtotime($date1);
    $d2=strtotime($date2);
    $days=round(($d1-$d2)/3600/24);
    echo $days;
    取第二天的日期:
    echo date("$days",strtotime("+1 day"));