• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/orm/fields/datetimefield.php
  • Класс: Bitrix\Main\ORM\Fields\DatetimeField
  • Вызов: DatetimeField::convertValueToDb
public function convertValueToDb($value)
{
	if ($value instanceof SqlExpression)
	{
		return $value;
	}

	try
	{
		return $value === null && $this->is_nullable
			? $value
			: $this->getConnection()->getSqlHelper()->convertToDbDateTime($value);
	}
	catch (ArgumentTypeException $e)
	{
		$exceptionMsg = $this->entity
			? "Type error in `{$this->name}` of `{$this->entity->getFullName()}`"
			: "Type error in `{$this->name}`";

		throw new ArgumentException(
			"{$exceptionMsg}: {$e->getMessage()}"
		);
	}
}