private function getTimeDrift(string $date) :? int
    {
        $now = new \DateTime();
        $now->format(\DateTime::RFC1123);

        try {
            $realDate = new DateTime($date);
        } catch (\Exception $e) {
            return null;
        }

        return (int)\abs($now->getTimestamp() - $realDate->getTimestamp());
    }
private function getTimeDrift(string $date) :? int
    {
        $now = new \DateTime();
        $now->format(\DateTime::RFC1123);

        try {
            $realDate = new DateTime($date);
        } catch (\Exception $e) {
            return null;
        }

        return (int)\abs($now->getTimestamp() - $realDate->getTimestamp());
    }
private function getTimeDrift ( string $ date ) : ? int { $ now = new \ DateTime ( ) ; $ now -> format ( \ DateTime :: RFC1123 ) ; try { $ realDate = new DateTime ( $ date ) ; } catch ( \ Exception $ e ) { return null ; } return ( int ) \ abs ( $ now -> getTimestamp ( ) - $ realDate -> getTimestamp ( ) ) ; }
Calculates the time difference between now and the provided date

@param string $date
@return int|boolean
Calculates the time difference between now and the provided date