php datetime минус datetime

Discussion in 'PHP' started by people2people, 11 Apr 2020.

  1. people2people

    people2people Banned

    Joined:
    1 Dec 2019
    Messages:
    159
    Likes Received:
    66
    Reputations:
    0
    php datetime минус datetime
    Code:
    $user_for_referall_datetime = "2020-04-11 14:28:11";
    почему данный код не работает?
    Code:
    $diff_time = date("Y-m-d H:i:s")->diff($user_for_referall_datetime);
    Выдает ошибку
    нужно настоящее время отнять от того, которое есть в базе данных.
     
    #1 people2people, 11 Apr 2020
    Last edited: 11 Apr 2020