I have a countdown function that (in part) returns the "time left" until a given date/time. The value is returned as a DateInterval object and is calculated using the diff method.
//calculate countdown time
$time_diff = $countdown->diff($current);
Given that $time_diff is a DateInterval object, how would I do this?
if ($time_diff > 60) {
//do stuff
}
I know the code above doesn't work, but how can/should I evaluate the equivalent condition ("more than 60 sec left in this DateInterval object")?
The problem is that the script used to return the "time left" as a Unix timestamp integer, and the function is utilized in a more procedural manner by a wide array of scripts in my system.
Thank you in advance for any helpful suggestions.