/** * Accepts two dates and returns the number of days between them * * @param string $start_date * @param string $end_date * @return int * @author Modern Tribe * @see TribeEventsQuery::dateDiff() **/ function tribe_get_days_between($start_date, $end_date) { $start_date = new DateTime($start_date); $end_date = new DateTime($end_date); // This doesn't work on php 5.2 // $interval = $start_date->diff($end_date); return TribeEventsQuery::dateDiff($start_date->format('Y-m-d'), $end_date->format('Y-m-d')); }