I am trying to get the PHP \"DateInterval\" value in \"total minutes\" value. How to get it? Seems like simple format(\"%i minutes\") not working?
Here is the sampl
Here is the excepted answer as a method in PHP7.2 style:
/** * @param \DateTime $a * @param \DateTime $b * @return int */ public static function getMinutesDifference(\DateTime $a, \DateTime $b): int { return abs($a->getTimestamp() - $b->getTimestamp()) / 60; }