• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/calc.php
  • Класс: CBPCalc
  • Вызов: CBPCalc::getDateTimeObject
private function getDateTimeObject($date)
{
	if ($date instanceof BizprocBaseTypeValueDate)
	{
		return (new DateTime())->setTimestamp($date->getTimestamp());
	}

	$df = MainTypeDateTime::getFormat();
	$df2 = MainTypeDate::getFormat();
	$date1Formatted = DateTime::createFromFormat($df, $date);
	if ($date1Formatted === false)
	{
		$date1Formatted = DateTime::createFromFormat($df2, $date);
		if ($date1Formatted)
		{
			$date1Formatted->setTime(0, 0);
		}
	}
	return $date1Formatted;
}