Subtract 1 day with PHP

后端 未结 10 790
我在风中等你
我在风中等你 2020-11-28 06:52

I\'m trying to take a date object that\'s coming out of my Drupal CMS, subtract one day and print out both dates. Here\'s what I have

$date_raw = $messageno         


        
10条回答
  •  不知归路
    2020-11-28 07:26

    Answear taken from Php manual strtotime function comments :

    echo date( "Y-m-d", strtotime( "2009-01-31 -1 day"));
    

    Or

    $date = "2009-01-31";
    echo date( "Y-m-d", strtotime( $date . "-1 day"));
    

提交回复
热议问题