• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/db/sqlhelper.php
  • Класс: BitrixMainDBSqlHelper
  • Вызов: SqlHelper::convertToDbDateTime
public function convertToDbDateTime($value)
{
	if (empty($value))
	{
		return "NULL";
	}
	elseif($value instanceof TypeDate)
	{
		if($value instanceof TypeDateTime)
		{
			$value = clone($value);
			$value->setDefaultTimeZone();
		}
		return $this->getCharToDateFunction($value->format("Y-m-d H:i:s"));
	}
	else
	{
		throw new MainArgumentTypeException('value', 'BitrixMainTypeDate');
	}
}