You are here

function cmfcCalendarV1Iranian::dateDiff in Calendar Systems 5

Same name and namespace in other branches
  1. 8 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::dateDiff()
  2. 8.2 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::dateDiff()
  3. 6.3 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::dateDiff()
  4. 6 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::dateDiff()
  5. 7.3 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::dateDiff()
  6. 7 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::dateDiff()
  7. 7.2 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::dateDiff()

File

calendar/v1/calendarSystems/iranian.class.inc.php, line 630

Class

cmfcCalendarV1Iranian

Code

function dateDiff($first, $second) {
  $first_date = explode("-", $first);
  $first_date = mktime(0, 0, 0, $first_date[1], $first_date[2], $first_date[0]);

  //echo $first_date[1];
  $second_date = explode("-", $second);
  $second_date = mktime(0, 0, 0, $second_date[1], $second_date[2], $second_date[0]);
  $totalsec = $second_date - $first_date;
  return $totalday = round($totalsec / 86400);
}