• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/calc.php
  • Класс: CBPCalc
  • Вызов: CBPCalc::makeTimestamp
private function makeTimestamp($date, $appendOffset = false)
{
	if (!$date)
	{
		return false;
	}

	//serialized date string
	if (is_string($date) && BizprocBaseTypeValueDate::isSerialized($date))
	{
		$date = new BizprocBaseTypeValueDate($date);
	}

	if ($date instanceof BizprocBaseTypeValueDate)
	{
		return $date->getTimestamp() + ($appendOffset? $date->getOffset() : 0);
	}

	if (intval($date)."!" === $date."!")
		return $date;

	if (($result = MakeTimeStamp($date, FORMAT_DATETIME)) === false)
	{
		if (($result = MakeTimeStamp($date, FORMAT_DATE)) === false)
		{
			if (($result = MakeTimeStamp($date, "YYYY-MM-DD HH:MI:SS")) === false)
			{
				$result = MakeTimeStamp($date, "YYYY-MM-DD");
			}
		}
	}
	return $result;
}