You are here

function cmfcCalendarV1Thai::dateDiff in Calendar Systems 8.2

Same name and namespace in other branches
  1. 8 calendar/v1/calendarSystems/thai.class.inc.php \cmfcCalendarV1Thai::dateDiff()
  2. 6 calendar/v1/calendarSystems/thai.class.inc.php \cmfcCalendarV1Thai::dateDiff()
  3. 7 calendar/v1/calendarSystems/thai.class.inc.php \cmfcCalendarV1Thai::dateDiff()
  4. 7.2 calendar/v1/calendarSystems/thai.class.inc.php \cmfcCalendarV1Thai::dateDiff()

Overrides cmfcCalendarV1Plugin::dateDiff

File

calendar/v1/calendarSystems/thai.class.inc.php, line 104

Class

cmfcCalendarV1Thai

Code

function dateDiff($first, $second) {
  $first_date = explode('-', $first);
  $first_date = parent::mktime(0, 0, 0, $first_date[1], $first_date[2], $first_date[0]);
  $second_date = explode('-', $second);
  $second_date = parent::mktime(0, 0, 0, $second_date[1], $second_date[2], $second_date[0]);
  $totalasec = $second_date - $first_date;
  return $totalday = round($totalasec / 86400);
}