• Модуль: learning
  • Путь к файлу: ~/bitrix/modules/learning/classes/general/course.php
  • Класс: CCourse
  • Вызов: CCourse::TimeToStr
static function TimeToStr($seconds)
{
	$str = "";

	$seconds = intval($seconds);
	if ($seconds <= 0)
		return $str;

	$days = intval($seconds/86400);
	if ($days>0)
	{
		$str .= $days." ".GetMessage("LEARNING_DAYS")." ";
		$seconds = $seconds - $days*86400;
	}

	$hours = intval($seconds/3600);
	if ($hours>0)
	{
		$str .= $hours." ".GetMessage("LEARNING_HOURS")." ";
		$seconds = $seconds - $hours*3600;
	}

	$minutes = intval($seconds/60);
	if ($minutes>0)
	{
		$str .= $minutes." ".GetMessage("LEARNING_MINUTES")." ";
		$seconds = $seconds - $minutes*60;
	}

	$str .= ($seconds%60)." ".GetMessage("LEARNING_SECONDS");

	return $str;
}