• Модуль: xdimport
  • Путь к файлу: ~/bitrix/modules/xdimport/classes/general/xdimport.php
  • Класс: CXDImport
  • Вызов: CXDImport::ParseTimesOfDay
static function ParseTimesOfDay($strTimesOfDay)
{
	if($strTimesOfDay == '')
		return false;

	$arResult = array();

	$arToD = explode(",", $strTimesOfDay);
	foreach($arToD as $strToD)
	{
		$arFound = array();
		if(
			preg_match("/^(d{1,2}):(d{1,2})$/", trim($strToD), $arFound)
			&& $arFound[1] <= 23
			&& $arFound[2] <= 59
		)
			$arResult[]=intval($arFound[1])*3600+intval($arFound[2])*60;
		else
			return false;
	}

	return $arResult;
}