I am trying to get difference between two dates. The format is coming from an API is Y-m-dTH:i:s.
Initially, I wanted to output something like this. 02h 10m but when the time difference is too great I had to switch to 01day 12hour 05minute format.
I tried using
$duration = 7600 OR $duration = 28800
{{gmdate('t', $duration)}}day {{gmdate('H', $duration)}}hour {{gmdate('i', $duration)}}minute
and
{{gmdate('d', $duration)}}day {{gmdate('H', $duration)}}hour {{gmdate('i', $duration)}}minute
This always return day value as 1 when the difference is just 2 hours.