• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/Calc/Libs/DateLib.php
  • Класс: BitrixBizprocCalcLibsDateLib
  • Вызов: DateLib::callLocDate
public function callLocDate(Arguments $args)
{
	$format = $args->getFirst();
	$date = $args->getSecondSingle();

	if (!$format || !is_string($format))
	{
		return null;
	}

	$reformFormat = $this->frameSymbolsInDateFormat($format);
	$timestamp = $date ? $this->makeTimestamp($date, true) : time();

	if (!$timestamp)
	{
		return null;
	}

	$formattedDate = date($reformFormat, $timestamp);
	// return FormatDate($format, $timestamp); - TODO
	if ($formattedDate === false)
	{
		return null;
	}

	return $this->replaceDateToLocDate($formattedDate, $reformFormat);
}