You are here

function cmfcCalendarV1::secondsToDays in Calendar Systems 5

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

convert seconds to days,hours,minuts,seconds as array

Parameters

integer $seconds:

Return value

array

File

calendar/v1/calendarV1.class.inc.php, line 314

Class

cmfcCalendarV1

Code

function secondsToDays($seconds) {
  $days = intval($seconds / 86400);
  $remain = $seconds % 86400;
  $hours = intval($remain / 3600);
  $remain = $remain % 3600;
  $mins = intval($remain / 60);
  $secs = $remain % 60;
  $r = array(
    'days' => $days,
    'hours' => $hours,
    'minutes' => $mins,
    'seconds' => $secs,
  );
  return $r;
}