How to get difference between days and date

前端 未结 1 353
忘掉有多难
忘掉有多难 2021-01-22 05:29
function duration($day, $date)
{
    $date1 = $date;
    //$date2 = date_create(\"Y/m/d\");        
    //$date1 = date_create(\"Y/m/d\", strtotime($date));
    //echo $         


        
相关标签:
1条回答
  • 2021-01-22 06:09

    Hello Please try this,

    $date = date_create('2000-01-01');
    date_add($date, date_interval_create_from_date_string('10 days'));
    echo date_format($date, 'Y-m-d');
    

    this will help you to add number of days, month etc to date.

    Thanks Amit

    0 讨论(0)
提交回复
热议问题